Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for nested JSON #2

Open
johndagostino opened this issue Jul 8, 2021 · 1 comment
Open

Support for nested JSON #2

johndagostino opened this issue Jul 8, 2021 · 1 comment

Comments

@johndagostino
Copy link

hey @iximiuz - great project

I've been playing around with it with kubernetes logs which are json output and one feature which would be awesome would be nested json objects as part of the map

pq 'json | map { .msg, .time, .res.statusCode as statusCode, .req.url as url } | select url'

where log entry is

{"name":"project-name","process":0,"environment":"sandbox","hostname":"masked-magic-api-7679cdd899-wbznv","pid":1,"req_id":"704a1e50-e03b-11eb-bf79-51b92d981c1b","level":30,"res":{"statusCode":200},"duration":0.7862819999999999,"req":{"url":"/health","reqId":"704a1e50-e03b-11eb-bf79-51b92d981c1b","method":"GET","query":{},"userAgent":"curl/7.64.0"},"msg":"request finish","time":"2021-07-08T22:25:45.654Z","v":0}
@iximiuz
Copy link
Owner

iximiuz commented Jul 8, 2021

Hi @johndagostino! Thanks for the feedback! Indeed, that would be a great addition to the current mapper's capabilities. I'll definitely add it once I'm back from vacation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants