Last active
November 8, 2022 19:56
-
-
Save srt32/89a5593007355081e77ad0efa27fc0a6 to your computer and use it in GitHub Desktop.
parse the JSONL export from honeybadger.io
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 characters
# usage: cat ~/Downloads/log_foo-bar-baz.jsonl | ruby honeybadger_parser.rb | |
require 'json' | |
data = ARGF.read | |
lines = data.split("\n") | |
grouped = lines.group_by do |line| | |
JSON.parse(line)["request"]["context"]["project_id"] | |
end | |
grouped_list = {} | |
grouped.map {|project_id, list| grouped_list[project_id] = list.size } | |
puts(grouped_list) |
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 characters
# usage: cat ~/Downloads/log_foo-bar-baz.jsonl | ruby paypal_error_parser.rb | |
require 'json' | |
data = ARGF.read | |
lines = data.split("\n") | |
grouped = lines.map do |line| | |
JSON.parse(line)["request"]["context"]["cancel_url"] | |
end | |
puts(grouped.uniq) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment