Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7633511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:54:21+00:00 2026-05-31T06:54:21+00:00

My log files have one json object per line. I use [json][1] to get

  • 0

My log files have one json object per line.
I use [json][1] to get a human readable output via

cat mylog.log | json -a field1 field2

Now I would like to have

tail -F mylog.log | json -a field1 field2

for a continuous output. But this seems not to
work, the shell simply hangs. If I use &| to
avoid buffering issues, the output is as if
I only run cat.

mylog.log looks like this:

{"field1": entry1a, "field2": entry2a, "field3": entry3a}
{"field1": entry1b, "field2": entry2b, "field3": entry3b}

Any suggestions?

[1] https://github.com/trentm/json

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T06:54:22+00:00Added an answer on May 31, 2026 at 6:54 am

    It’s looks like json first loads the whole stdin into a buffer and only then processes the data, but you should still be able to achieve stream processing by calling it for each of the lines added to the log file, something like this:

    tail -F mylog.log | while read line; do echo "$line" | json -a field1 field2; done
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several log files of events (one event per line). The logs can
I have observed following error logs in one of log files 2012-01-31 10:52:46,424 IST
Have tried spooling, have tried command line notation: log \\networked_location\rman.log Nothing works to get
I have a use case , where I need to display some log files
I have one server which has nothing but xls log files. Each file is
I have large log files which contains timestamps every one second.what I need is
I have one requirement that i have to place the log file in the
How can you find out what transaction log backup files have been restored using
We have multiple log files like database log, weblog, quartzlog in our application. Any
I have some HUGE log files (50Mb; ~500K lines) I need to start filtering

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.