With the --json
flag, how can I request that the "lines" section of the JSON is omitted?
#2821
-
I'm searching very large binary files with sparse newlines, so some of the data that comes into the "lines" section is very very large. Is there a way I can request that the "lines" section is omitted from the JSON response? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Nope. You'll have to filter it out yourself. I'm not keen on adding different incompatible subsets of the JSON format. I note that this generally shouldn't change the memory requirements. ripgrep already requires that each line, in full, is put on the heap. It does mean some extra deserialization/serialization work, but that should hopefully be pretty fast. And the additional memory requirements should be minimal if you do it one JSON line at a time. |
Beta Was this translation helpful? Give feedback.
Nope. You'll have to filter it out yourself. I'm not keen on adding different incompatible subsets of the JSON format.
I note that this generally shouldn't change the memory requirements. ripgrep already requires that each line, in full, is put on the heap. It does mean some extra deserialization/serialization work, but that should hopefully be pretty fast. And the additional memory requirements should be minimal if you do it one JSON line at a time.