From 618c88a6e3c594b8382b4c61710a968c6adcdf49 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sat, 3 Mar 2018 18:03:17 +0100 Subject: Output YAML --- yamlexample.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 yamlexample.py (limited to 'yamlexample.py') diff --git a/yamlexample.py b/yamlexample.py new file mode 100755 index 0000000..7001b23 --- /dev/null +++ b/yamlexample.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# +# An example on how to read the YAML output from etisnoop +# Pipe etisnoop to this script +# +# License: public domain + +import sys +import yaml + +for frame in yaml.load_all(sys.stdin): + print("FIGs in frame {}".format(frame['Frame'])) + for fib in frame['LIDATA']['FIC']: + if fib['FIGs']: + for fig in fib['FIGs']: + print(" FIG " + fig['FIG']) + -- cgit v1.2.3