Closed tsenart closed 6 years ago
Hey, thanks for opening the issue! I'll just add JSONLines support as another alternative to CSV and JSON. Until that's done, you might want to use the simpler jq -s
to collect JSONLines into an array, e.g.:
$ echo 1 2 3 '{"a":123}' | jq -s
[
1,
2,
3,
{
"a": 123
}
]
@sgreben: Nice!
To be honest, with such a simple jq
command at hand (jq -s
), I don't know if it's worth it to implement it directly in jp
. I'd just clearly document how to work with JSONLines using that jq command.
@tsenart yeah, that makes sense. I've added a JSONLines section to the README now.
I am thinking about significantly re-designing the CLI, perhaps that will be a better time to add "native" JSONLines support. I'd close the issue for now - is that ok with you?
SGTM
Thanks for this project. It looks very promising and match made in heaven for integration with Vegeta in ways similar to these: https://github.com/tsenart/vegeta#usage-real-time-analysis
Vegeta can dump results in JSONLines format and I couldn't figure out if JSONPath supports this.
A current workaround is to use a rather difficult jq expression to convert JSONLines to JSON:
jq -nr '"[", try (input|tojson, repeat(",\n\(input|tojson)")), "]"'