PaulJuliusMartinez / jless

jless is a command-line JSON viewer designed for reading, exploring, and searching through JSON data.
https://jless.io
MIT License
4.79k stars 92 forks source link

Remove `input.` from the `input.log.entries[1113].response.headers[4].name`? #165

Open stdedos opened 3 weeks ago

stdedos commented 3 weeks ago

Is there a way to remove input. from the input.log.entries[1113].response.headers[4].name?

I tried to create a jq filter, dummingly thinking that the structure starts with input, whereas


$ jq 'keys' com.har
[
  "log"
]
$

😅 
PaulJuliusMartinez commented 3 weeks ago

You can use yq to yank a path to the currently focused node that you can pass to jq. There's no need to manually copy and paste the path in the status line.

Alternatively, if clipboard support isn't working, you can also press pq to print out the path on its own, then copy and paste that using an alternate method.

If you do want the full path to the exact node that's currently focused, you can also use yp.

You can see the full list of supported commands if you type :help.

stdedos commented 3 weeks ago

I see, thank you!

pq is not working for me (but I am in jless 0.8.0 because of https://github.com/PaulJuliusMartinez/jless/issues/137, so mMMV 😅)

Ofc knowing the commands is helpful - and still "I see /input.?/ as useless". Of course, I might have failed to see scenarios that it makes sense.