# Suricata alerts / GraphViz

**URL:** <https://forum.suricata.io/t/suricata-alerts-graphviz/2528>\
**Category:** Tips and Tricks\
**Created:** [May 31, 2022, 6:47am UTC](https://forum.suricata.io/t/suricata-alerts-graphviz/2528 "2022-05-31T06:47:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![suricatalfon](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/suricatalfon/32/385_2.png) [@suricatalfon](https://forum.suricata.io/u/suricatalfon)\
**Post date:** [May 31, 2022, 6:47am UTC](https://forum.suricata.io/t/suricata-alerts-graphviz/2528/1 "2022-05-31T06:47:44Z")

</div>

Hí,

`cat eve.json | jq -c 'select(.alert and .http) | [.src_ip,.dest_ip,.http.http_method,.http.url,.alert.signature,.flow_id]' | ag -v IPREP | tr -d '"[]' | awk 'BEGIN{print "digraph \"G\"{graph[rank=same];ranksep=3;node[style=\"rounded,filled\" shape=box color=lightblue3];rankdir=LR;pin=true;forcelabels=true;splines=polyline;overlap=false;concentrate=true;edge[arrowhead=vee,arrowtail=inv,arrowsize=.7,color=cornflowerblue,fontsize=10,fontcolor=navy];"};{print "\""$1"\"" " -> " "\""$2"\"" " -> " "\""$3" " $4"\"" " -> " "\""$5"\"" "[label="$6"];"};END{print "}"}' FS=, | ag -v kumchakl1|dot -Gdpi=75 -Tpng | display -`

…

 ![alerts](https://canada1.discourse-cdn.com/flex030/uploads/suricata/original/2X/8/8bbb9dc7a138c0d850e4d17d02d4b7a851fc7174.png)

`cat eve.json|ag -v 'JA3|Firehol|Not Suspicious|Generic Protocol'|jq -c 'select(.alert) | [.src_ip,.dest_ip,.alert.category,.alert.signature,.flow_id]' | tr -d '"[]' | head |sed 's/null//' | awk 'BEGIN{print "digraph \"G\"{graph[rank=same];ranksep=3;node[style=\"rounded,filled\" shape=box color=lightblue3];rankdir=LR;pin=true;forcelabels=true;splines=polyline;overlap=false;concentrate=true;edge[arrowhead=vee,arrowtail=inv,arrowsize=.7,color=cornflowerblue,fontsize=10,fontcolor=navy];"};{print "\""$1"\"" " -> " "\""$2"\"" " -> " "\""$3"\"" " -> " "\""$4"\"" "[label="$5"];"};{print "\""$4"\"" "[shape=ellipse, color=lightgrey, style=filled, fillcolor=orange]","\""$1"\"" "[shape=ellipse, color=lightgrey, style=filled, fillcolor=khaki]","\""$2"\"" "[shape=ellipse, color=lightgrey, style=filled, fillcolor=palegreen]"};END{ print "}"}' FS=, | dot -Gdpi=100 -Tpng -o suricata.png`

 ![suricata](https://canada1.discourse-cdn.com/flex030/uploads/suricata/original/2X/5/54a285e4d614d30498869fa3a42c471e1f31c6ce.png)
