aboutsummaryrefslogtreecommitdiffstats
path: root/yamlexample.py
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-03-03 18:03:17 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-03-03 18:03:17 +0100
commit618c88a6e3c594b8382b4c61710a968c6adcdf49 (patch)
tree314e99e56cc0715fdcbeed2189fc6056a5c6e4d0 /yamlexample.py
parent4e196f337303304cc9cb15b5d7d345646486e68f (diff)
downloadetisnoop-618c88a6e3c594b8382b4c61710a968c6adcdf49.tar.gz
etisnoop-618c88a6e3c594b8382b4c61710a968c6adcdf49.tar.bz2
etisnoop-618c88a6e3c594b8382b4c61710a968c6adcdf49.zip
Output YAML
Diffstat (limited to 'yamlexample.py')
-rwxr-xr-xyamlexample.py17
1 files changed, 17 insertions, 0 deletions
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'])
+