How to write processors?

(Benjamin Knofe) #1


I recently wrote a new beat for serial data, called serialbeat. Now I want to add a processor to this beat, which does a few things with the data before sending it somewhere. Is there any documentation on how to write a processor? If not, do you have any other resources or info you can give me for doing that?

Thank you!

(Carlos PĂ©rez Aradros) #2

Hi @benben,

I don't think we have any documentation on that, perhaps you can get some inspiration from a simple one, like add_locale. Don't forget to register it here:

(Benjamin Knofe) #3

Hi @exekias, thanks for the info. That should be enough for a start. Is there a way to have a processor only in the repository of a beat or do I need to fork and update the whole beats lib and then update my beat with this custom version. Thinking of something like a beat-scoped processor.

(Steffen Siering) #4

You can register the plugin using the empty import in your own beats main.go file. No need to fork beats.

Given your processing is specialised, why you need to introduce a new processor type?

(Benjamin Knofe) #5

Thanks for you answer. I want to process serial data and send it directly to ES without having to run a logstash inbetween.

(Steffen Siering) #6

Right. I just wonder why you need to introduce a configurable process, instead of having the data collector do the required processing.

(system) #7

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.