Parse Log & Create Flow Diagram - Ideas/Tools

Hi,

I would like to develop a script which parses the log file and generates a flow diagram ( graphical display ).

We have an application, for understanding the sequence of functions call made, we have an debug line at "ENTRY/EXIT" of function. I have a small log parsing script which grep the pattern and prints the function entry/exit points by using TAB, but understanding the flow with that output is not so trivial.

I wish I can plot the result to a flow diagram, like a UML Sequence diagram.

Appreciate if we could provide some directions on this.

Let me know if am unclear with my query.

Thanks,
Nagarajan G

If you can translate the data you have into a list of nodes and edges, you should be able to do it with the dot tool. It can turn lists like this:

digraph finite_state_machine {
	rankdir=LR;
	size="8,5"
	node [shape = doublecircle]; LR_0 LR_3 LR_4 LR_8;
	node [shape = circle];
	LR_0 -> LR_2 [ label = "SS(B)" ];
	LR_0 -> LR_1 [ label = "SS(S)" ];
	LR_1 -> LR_3 [ label = "S($end)" ];
	LR_2 -> LR_6 [ label = "SS(b)" ];
	LR_2 -> LR_5 [ label = "SS(a)" ];
	LR_2 -> LR_4 [ label = "S(A)" ];
	LR_5 -> LR_7 [ label = "S(b)" ];
	LR_5 -> LR_5 [ label = "S(a)" ];
	LR_6 -> LR_6 [ label = "S(b)" ];
	LR_6 -> LR_5 [ label = "S(a)" ];
	LR_7 -> LR_8 [ label = "S(b)" ];
	LR_7 -> LR_5 [ label = "S(a)" ];
	LR_8 -> LR_6 [ label = "S(b)" ];
	LR_8 -> LR_5 [ label = "S(a)" ];
}

into graphs like this:

See Home | Graphviz - Graph Visualization Software and their gallery.

1 Like

Thanks for the pointing me to the right direction,

Now I am exploring the option of using UMLGraph, which is text based, also uses Graphviz & Gnuplot.