Created
December 25, 2019 05:57
-
-
Save bearice/ccdf12cfd0905ccc0fb9f9e1e80c1c57 to your computer and use it in GitHub Desktop.
Revisions
-
bearice created this gist
Dec 25, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ def strip_isis_id: .|match("([-\\w]+).00").captures[0].string|gsub("-";"_") ; def to_dot: ["\(.id) -- {",(.n|join(" ")),"}"]|join("") ; ["strict graph {", "node [overlap=false]", (."isis-database-information"[]|."isis-database"[]|select(.level[0].data=="2")|."isis-database-entry"[]|{ id:(."lsp-id"[0].data|strip_isis_id), n:[."isis-neighbor"[]|."is-neighbor-id"[0].data|strip_isis_id], p:[."isis-prefix"[]|."address-prefix"[0].data], rid:."isis-header"[0]."router-id"[0].data }|to_dot), "}"] | join("\n")