Is there a standard interface/framework to create a new beats output. To be specific, we want to create a new output using which beats can send data to IBM Bluemix (logmet service).
Currently we have taken logstash ouput, changed it to add Bluemix authentication and send data. But this would mean we compile our own version of libbeat and use which we would like to avoid.
Is there a way one could write a new output and plugin with beats?
UPDATE: I removed the comment part about the generator as this is packetbeat protocol related. Sorry, too early in the morning ...
The above will still not prevent that you have to compile your own version of the beat, but it gets much simpler as you don't have to maintain a full fork of the beats repository.
@ruflin, thank you for the input. Does this mean, I clone filebeat and libbeat and then modify filebeat's main.go and libbeat/publisher/publish.go and build ?
Yes, but I think you only need to modify the main.go and need to modify the publish.go. Your own output will be in a separate repo / package that you will refer to in the main.go file.
In this example the output is available in repository github.com/myuser/mybeatsoutputs. With internal plugin achritecture of outputs, the output will be immediately available. Filebeat itself here acts like the 'framework' to use.
How you structure your repositories is all up to you. You can also put all custom beats + outputs into one repository and use the import trick on any beat, as every beat available can act as 'framework'.
@ruflin, This is what I did to create a new output, build and test with filebeat
a) copied logstash output to my repo (ex: github.com/ageetha/logmet)
b) changed package name and references from logstash to logmet ( I did
this as my output is a modified version of logstash output)
c) cloned this repo @ /root/src/github.com/
d) cloned beats 1.3 @ /root/src/github.com
e) modified /root/src/github.com/elastic/beats/filebeat/main.go to include imports to my repo
f)
modified /root/src/gitbub.com/elastic/beats/libbeat/outputs/outputs.go (
inclded two new parameters I introduced in yml file )
g) built filebeat
is there a way to introduce output specific yml parameters without
having to modify libbeat/outputs/outputs.go. I would like to keep all my
output specific code and config within my repo
No run go build in $GOPATH/src/github.com/ageetha/filebeat-logmet directory and you will get your filebeat binary. Advantage of this solution is, you can more easily upgrade to new filebeat just by checking another branch from filebeat. Updating to filebeat 5.0 will require you to change main.go to:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.