Giter Club home page Giter Club logo

logstash-json's People

Contributors

aweiker avatar bmoe avatar c404 avatar dertim1 avatar kakkoyun avatar mattias-lundell avatar nburkley avatar ne1ro avatar nkezhaya avatar samhamilton avatar svetob avatar take-five avatar tim2cf avatar ulissesalmeida avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

logstash-json's Issues

Use Travis CI

Should use Travis CI to build and test, and also upload releases to hex.

Need to add field dynamically

We need to add a field to our logs that is not available at compile-time.

While we can add metadata dynamically we'd like the value to be a separate field rather than a metadata sub-field.

Is there any way we can dynamically update the logger configuration to add a new field?

If not, would you be open to a pull request to add this? What would be the best way of doing this?

Thanks in advance!

Unchecked dependencies for environment tes

Hey there!

I just add the lib to my project {:logstash, github: "svetob/logstash-json"} and when I try to run tests or the app Im getting:

Unchecked dependencies for environment test:
* logstash (https://github.com/svetob/logstash-json.git)
  could not find an app file at "_build/test/lib/logstash/ebin/logstash.app". This may happen if the dependency was not yet compiled, or you specified the wrong application name in your deps, or the dependency indeed has no app file (then you can pass app: false as option)
** (Mix) Can't continue due to errors on dependencies

Any clue? Thanks!

cannot import in logstash

Hi, I'm trying to use logstash-json with logstash 2.3 (in a docker container). Here is how I launch logstash :

docker run --rm -ti -p 5001:5001 logstash:2.3 logstash --debug -e 'input { tcp {codec => json port => "5001"} } output { stdout { } }'

I can see with wireshark that the packets arrive to the server, but nothing in logstash :-(, If I remove the codec => json it works but I have a warning telling me that the charset is not good (not utf-8). If I change the charset to ASCII for example, it doesn't work. So do you have a config that works with logstash ?

Add a formatter for TCP logging

I'm finding I need to mess around with some of the hard-coded attributes in the log message. For instance, our logstash expects 'level' to be in integer -- if we send strings, we have trouble. Same with 'pid'.

Might it be possible to have a configurable formatter that can dynamically modify the log event? So we could do something like:

config :logger, :logstash
   formatter: {MyApp, :formatter}

with module MyApp having

def formatter(event) do
   event
   |> Map.put(:thread_id, event[:pid])
   |> Map.put(:level, convert_level(event[:level])
   |> Map.delete(:pid)
end

Does this make sense? I did a quick and dirty you can look at in my fork. I'll add tests and docs if this is of interest to you. Also -- am pretty new to Elixir and am open to criticism and guidance.

Thanks!

Publish new hex package

Hi!

Are you planing on releasing a new version of the hex package with the fix #30? I would like to update my version :)

Use message formatter from :console

The :console message formatter does a good job of formatting the message, let's use it to ensure the message is always a nicely formatted string.

Remove timex dependency

The problem with timex is that it's a large dependency, plus it also comes with tzdata, which requires starting the :timex application. This also starts tzdata which performs HTTP requests to an external database to download the latest timezone updates. The dependencies between the logger backend and the :timex application at startup also causes crashes if not carefully handled.

I want to do this much simpler by removing this dependency and logging @timestamp in UTC time, ignoring local timezone. Perhaps later we'll discover a simpler way to get the local timezone, but for now this is good enough.

Optional JSON library selection

Phoenix and may others now don't use JSON encoding libraries implicitly, instead allowing for configuration via config.exs. This is great, because it allows to use on package across the whole application instead of use multiple variations of the same.

I think this library would benefit from switching to a similar approach, to drop explicit dependency on Poison in favor of config option.

Thanks a lot for a great library!

application is crashed on some data

GenEvent handler {LogstashJson.Console, :json} installed in Logger terminating
** (FunctionClauseError) no function clause matching in Poison.Encoder.BitString.chunk_size/3
    (poison) lib/poison/encoder.ex:139: Poison.Encoder.BitString.chunk_size(<<171, 152, 70, 16, 37>>, nil, 0)
    (poison) lib/poison/encoder.ex:134: Poison.Encoder.BitString.escape/2
    (poison) lib/poison/encoder.ex:95: Poison.Encoder.BitString.escape/2
    (poison) lib/poison/encoder.ex:101: Poison.Encoder.BitString.escape/2
    (poison) lib/poison/encoder.ex:95: Poison.Encoder.BitString.escape/2
    (poison) lib/poison/encoder.ex:88: Poison.Encoder.BitString.encode/2
    (poison) lib/poison/encoder.ex:227: anonymous fn/4 in Poison.Encoder.Map.encode/3
    (poison) lib/poison/encoder.ex:228: Poison.Encoder.Map."-encode/3-lists^foldl/2-0-"/3

Reconnnect on connection issues

Must close socket and attempt to reconnect if a connection issue is encountered.

This also means either buffering or dropping messages until connection is restored.

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.