Last active
August 31, 2019 15:21
-
-
Save gbirke/84ed97eb208f09a5e3c1ccd0e6a2a89f to your computer and use it in GitHub Desktop.
jq example files
This file contains 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 characters
reduce inputs as $obj ( | |
{}; | |
if $obj.severity == "E" then | |
. + { | |
($obj.severity): (.[$obj.severity] + 1) | |
} | |
else | |
. | |
end | |
) |
This file contains 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 characters
reduce inputs as $obj ( | |
{}; | |
. + { | |
($obj.severity): (.[$obj.severity] + 1) | |
} | |
) |
This file contains 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 characters
reduce inputs as $obj ( | |
{}; | |
if ($obj.error.msg|test("widget";"i")) then | |
. + { | |
($obj.severity): (.[$obj.severity] + 1) | |
} | |
else | |
. | |
end | |
) |
This file contains 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 characters
{"ts":"2017-11-30 06:45:02","severity":"I","error":{"msg":"Reticulating splines","splines":1}} | |
{"ts":"2017-11-30 06:45:12","severity":"I","error":{"msg":"Probing froobles (Widget 5)","names":["frb23","frb42"]}} | |
{"ts":"2017-11-30 06:45:57","severity":"E","error":{"msg":"Widget exploded"}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment