0

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 and jid do not reload when a file changes, even using watch
  • 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
3
  • tail -f doesn't help? You can filter output with sed or other.
    – Paulo
    Mar 31, 2018 at 17:11
  • Is it feasible to adjust your program to save a fresh copy every time the JSON file changes? This would only be in ‘debug’ mode,...
    – Scot
    Apr 2, 2018 at 5:31
  • No, JSON updates tens of times a second. Apr 3, 2018 at 2:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.