New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle JSON inputs #30

Open
wants to merge 6 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@antifuchs
Copy link

antifuchs commented Jan 2, 2019

Summary

This PR makes unilog handle JSON log inputs from stdin, with these assumptions:

  • Each log event is a JSON object
  • log events are separated by \n (much like json.Encoder formats them)
  • timestamp fields are called "ts"
  • criticality level fields are called "clevel"

This happens to be pretty compatible with Splunk, AFAICT.

This is an incompatible change, as it alters the Filter interface.

Motivation

I would like our JSON log-emission story to be much better, and this
might be a good first stepping stone towards that world; in particular:

  • JSON logs render nicely in most tools
  • Splunk is much much better at parsing JSON logs than at splitting up
    fields via regexes, apparently.

Test plan

I wrote some automated tests, but I guess we'll have to run it and see.

Rollout/monitoring/revert plan

Merge this, integrate it into our unilog-using log ingester and then
roll that out.

@asf-stripe asf-stripe force-pushed the asf-json branch from dae4cec to 3e8ab10 Jan 2, 2019

@stripe-ci

This comment has been minimized.

@asf-stripe

This comment has been minimized.

Copy link
Contributor

asf-stripe commented Jan 2, 2019

I'm not sure this is completely ready yet, but! R, @aditya-stripe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment