Giter VIP home page Giter VIP logo

Comments (6)

antonmedv avatar antonmedv commented on July 19, 2024

For this purpose I have this https://github.com/antonmedv/eat

from fx.

Jim-Lambert-Bose avatar Jim-Lambert-Bose commented on July 19, 2024

Hum... not quite. That supports eating a whole file. Iโ€™m hoping to support interspersed text in the JSON. We have logs that are a mix of plain text and JSON

from fx.

antonmedv avatar antonmedv commented on July 19, 2024

Can you show an example?

from fx.

Jim-Lambert-Bose avatar Jim-Lambert-Bose commented on July 19, 2024

This is a REST backend service with a proxy in front of it. The proxy does plain text logging and the backend does JSON logging. The logs are streamed together from a kubernetes POD and a request looks like:
{
"comment": "",
"fields.time": "2019-01-20T22:32:38Z",
"ip": "100.65.12.18",
"latency": " 21.215983ms",
"level": "info",
"method": "PUT",
"msg": "[GIN] --------------------------------------------------------------- GinLogrusWithTracing ----------------------------------------------------------------",
"path": "/products/manasi-test-id",
"requestID": "36763cff53b68dce:532fdd959b064e8a:56b5f4bdec9a08af:0",
"status": 200,
"time": "2019-01-20T22:32:38Z",
"user-agent": "Go-http-client/1.1"
}
time="2019-01-20T22:32:38Z" level=info msg="proxyRequest took 27.679495ms" path=/products/manasi-test-id x-service-ticket=true requestID="36763cff53b68dce:393a4a39863433af:319aaa8a29f1957a:0" method=PUT
time="2019-01-20T22:32:38Z" level=debug msg="updateMetrics: proxyRequest / 31ms / 27.679495ms" path=/products/manasi-test-id x-service-ticket=true requestID="36763cff53b68dce:393a4a39863433af:319aaa8a29f1957a:0" method=PUT
time="2019-01-20T22:32:38Z" level=info msg="updateMetrics took 1.058ยตs" requestID="36763cff53b68dce:393a4a39863433af:319aaa8a29f1957a:0" method=PUT path=/products/manasi-test-id x-service-ticket=true
time="2019-01-20T22:32:38Z" level=info msg="[GIN] --------------------------------------------------------------- GinLogrusWithTracing ----------------------------------------------------------------" path=/products/manasi-test-id latency=" 28.62963ms" user-agent=Go-http-client/1.1 requestID="36763cff53b68dce:7fc8d054c277ae01:393a4a39863433af:0" status=200 comment= method=PUT ip=100.65.12.18 time="2019-01-20T22:32:38Z"

from fx.

Jim-Lambert-Bose avatar Jim-Lambert-Bose commented on July 19, 2024

you can see the mix content. it would be great if fx just wrapped the plain text in some sort of default JSON object or just ignored it.

from fx.

antonmedv avatar antonmedv commented on July 19, 2024

I think this can go inside eat tool to, if you can write a parser for it.

from fx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.