Git Product home page Git Product logo

Comments (5)

peterbourgon avatar peterbourgon commented on May 15, 2024

All the OK Log ingest endpoints care about is receiving newline-delimited records. Correct me if I'm wrong, but syslog already meets this contract. If that's true, anything which emits syslog should already be fully compatible with OK Log.

from oklog.

mattkanwisher avatar mattkanwisher commented on May 15, 2024

So also Syslog supports structured logging via Json, your probably aware as your other framework does it https://github.com/go-kit/kit/blob/master/log/json_logger.go . I couldn't find anything about OKLog supporting structured logs?

from oklog.

peterbourgon avatar peterbourgon commented on May 15, 2024

OK Log treats log records as opaque byte-slices. The query interface is grep. You're free to send structured logs, unstructured logs, or anything you want into it, as long as each record is newline-delimited.

from oklog.

peterbourgon avatar peterbourgon commented on May 15, 2024

We had a rousing discussion on Twitter, from that I've updated the README with some details about querying structured logs, anything more than that is not on a concrete roadmap, though I'm curious about what log parsing "plugins" might look like at the query or storage layer...

from oklog.

roondar avatar roondar commented on May 15, 2024

From this code: https://gist.githubusercontent.com/marcelom/4218010/raw/53b643bd056d03ffc21abcfe2e1b9f6a7de005f0/pysyslog.py

#!/usr/bin/env python

## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.

HOST, PORT = "0.0.0.0", 514

import SocketServer
import sys


class SyslogUDPHandler(SocketServer.BaseRequestHandler):

        def handle(self):
                data = bytes.decode(self.request[0].strip())
                socket = self.request[1]
                print( "%s : " % self.client_address[0], str(data))
                sys.stdout.flush()

if __name__ == "__main__":
        try:
                server = SocketServer.UDPServer((HOST,PORT), SyslogUDPHandler)
                server.serve_forever(poll_interval=0.5)
        except (IOError, SystemExit):
                raise
        except KeyboardInterrupt:
                print ("Crtl+C Pressed. Shutting down.")

Then run : python2 ./pysyslog.py | oklog forward localhost

from oklog.

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.