logstash-plugins / logstash-filter-zeromq Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
logstash-filter-zeromq (0.1.6)
logstash.conf
input {
stdin { codec => json }
}
filter {
#Decorate with user meta data
mutate {
add_field => [ "metadata", '{"app":"myapp", "user":"myuser"}']
}
zeromq{
field => "metadata"
add_tag => [ "test" ] # results in test, test in [tags]
#add_tag => [ "test1", "test2" ] # results in test1, test2, test1, test2 in [tags]
}
}
output {
stdout { codec => rubydebug }
}
Output for stdin of {}:
{
"@version" => "1",
"@timestamp" => "2015-11-27T04:01:08.114Z",
"host" => "myhost",
"metadata" => "{..lots of data filled in from zeromq...}",
"tags" => [
[0] "test",
[1] "test"
]
}
Hey there,
I have trouble putting the filter to work.
My little python script looks like this:
context = zmq.Context()
consumer_receiver = context.socket(zmq.REP)
consumer_receiver.bind("tcp://0.0.0.0:5557")
while True:
work = consumer_receiver.recv()
consumer_receiver.send(work)
And my logstash config:
input {
tcp { port => 5000 }
}
filter {
zeromq {
address => "tcp://192.168.59.3:5557"
}
}
output {
stdout { codec => rubydebug }
}
This should send the event to the script and get the same event in return, but I got the following message:
{:timestamp=>"2015-03-02T18:05:33.390000+0100", :message=>"0mq filter exception", :address=>"tcp://192.168.59.3:5557", :exception=>#<NoMethodError: undefined method `[]' for nil:NilClass>, :backtrace=>["/opt/logstash/lib/logstash/event.rb:163:in `overwrite'", "/opt/logstash/lib/logstash/filters/zeromq.rb:197:in `filter'", "(eval):23:in `initialize'", "org/jruby/RubyProc.java:271:in `call'", "/opt/logstash/lib/logstash/pipeline.rb:262:in `filter'", "/opt/logstash/lib/logstash/pipeline.rb:203:in `filterworker'", "/opt/logstash/lib/logstash/pipeline.rb:143:in `start_filters'"], :level=>:warn}
nil
What do I miss?
EDIT: Forgot to mention... I am using logstash 1.4.2 on fedora20
logstash.noarch 1.4.2-1_2c0f5a1 @logstash-1.4
logstash-contrib.noarch 1.4.2-1_efd53ef @logstash-1.4
(This issue was originally filed by @suyograo at elastic/logstash#2434)
logstash-filter-zeromq and logstash-output-zeromq are using utils/zeromq.rb file which was duplicated during beta1 as part of elastic/logstash#2055. Previously, before the plugin separation, they shared the same file. We know have to DRY this up to a new plugin like https://github.com/logstash-plugins/logstash-mixin-aws which has common utils code for EC2 input and output.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.