Comments (3)
Hmm, are you using the latest version 0.1.2? There was a bugfix in it to fix an issue causing logs to not appearing in logstash. But this looks like it could potentially be a different issue.
from logstash-json.
Hum I append this in my mix.exs
:
defp deps do
[{:logstash, github: "svetob/logstash-json"}]
end
So I think it's using master
?
from logstash-json.
Tested this locally now.
Started logstash using the command from the first post:
docker run --rm -ti -p 5001:5001 logstash:2.3 logstash --debug -e 'input { tcp {codec => json port => "5001"} } output { stdout { } }'
Configuring logstash-json version 0.3.0 to connect to port 5001:
use Mix.Config
config :logger,
backends: [
{LogstashJson.TCP, :logstash},
{LogstashJson.Console, :json}
]
config :logger, :logstash,
level: :debug,
host: System.get_env("LOGSTASH_TCP_HOST") || "localhost",
port: System.get_env("LOGSTASH_TCP_PORT") || "5001",
fields: %{appid: "logstash-json"}
config :logger, :json,
level: :info
Starting with iex -S mix
, logstash accepts connection:
Accepted connection {:client=>"172.17.0.1:59212", :server=>"0.0.0.0:5001", :level=>:debug, :file=>"logstash/inputs/tcp.rb", :line=>"142", :method=>"server_connection_thread"}
config LogStash::Codecs::JSONLines/@charset = "UTF-8" {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"153", :method=>"config_init"}
config LogStash::Codecs::JSONLines/@delimiter = "\n" {:level=>:debug, :file=>"logstash/config/mixin.rb", :line=>"153", :method=>"config_init"}
Pushing flush onto pipeline {:level=>:debug, :file=>"logstash/pipeline.rb", :line=>"458", :method=>"flush"}
Sending a log message:
iex(2)> Logger.info "hi"
{"module":null,"metadata":null,"message":"hi","line":2,"level":"info","function":null,"@timestamp":"2016-09-19T20:54:39.213+02:00"}
:ok
Logstash receives the message:
filter received {:event=>{"module"=>nil, "metadata"=>[], "message"=>"hi", "line"=>2, "level"=>"info", "function"=>nil, "appid"=>"logstash-json", "@timestamp"=>"2016-09-19T18:54:39.213Z", "@version"=>"1", "host"=>"172.17.0.1", "port"=>59212}, :level=>:debug, :file=>"(eval)", :line=>"18", :method=>"filter_func"}
output received {:event=>{"module"=>nil, "metadata"=>[], "message"=>"hi", "line"=>2, "level"=>"info", "function"=>nil, "appid"=>"logstash-json", "@timestamp"=>"2016-09-19T18:54:39.213Z", "@version"=>"1", "host"=>"172.17.0.1", "port"=>59212}, :level=>:debug, :file=>"(eval)", :line=>"23", :method=>"output_func"}
2016-09-19T18:54:39.213Z 172.17.0.1 hi
It seems that with 0.3.0 there are no errors, either that or I am not able to reproduce this issue locally. @rdesgrange-lf if with {:logstash_json, "~> 0.3.0"}
you are still getting errors, please post a copy of the errors from the logstash output here.
from logstash-json.
Related Issues (14)
- Reconnnect on connection issues HOT 2
- Need to add field dynamically HOT 2
- Under heavy logging, an application can become unresponsive HOT 2
- Remove timex dependency
- Add a formatter for TCP logging HOT 1
- application is crashed on some data HOT 3
- Use Travis CI
- Publish new hex package HOT 1
- Unchecked dependencies for environment tes HOT 4
- Optional JSON library selection HOT 1
- Use message formatter from :console
- UDP appender HOT 1
- Add :error_log parameter
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logstash-json.