I'm trying to monitor a JSON file a program uses as logger. The file changes multiple times a second, and I'd like to keep an eye on how the values evolve over time.
What I've tried so far:
jq
andjid
do not reload when a file changes, even usingwatch
watch -n 0.1 -d 'cat test.json | python -m json.tool'
can reload the file correctly, but it cannot be queried or scrolled- Text editors acknowledge the changes, but either require a prompt to take them or reset the scroll position on reload
tail -f
doesn't help? You can filter output with sed or other.