gogstash icon indicating copy to clipboard operation
gogstash copied to clipboard

Splitting one input into multiple outputs

Open MayurVirkar opened this issue 5 years ago • 3 comments

Hello, Basically, I have one input record which is JSON of array of 1000 records, I need to split them into individual 1000 records and run filters on them and insert them individually into ELK. How can I do it?

MayurVirkar avatar Apr 24 '20 13:04 MayurVirkar

Hi, I'm interested by the same feature. Based on my understanding of the code unfortunately it looks like Gogstash filters only allow exactly 1 (one) event out (as in one event in -> one event out).

Can anyone confirm this ?

I have several use-cases where it'd be useful for filters to allow either zero, one, or multiple events out:

  • "splitting" as requested by Mayur above is one of those where we would let multiple events out of the filter.
  • "dropping" events would also be a use-case for a filter that returns zero events (although this can already be done through conditional outputs I feel it might be interesting to remove unnecessary processing of events we want to discard).
  • Lastly, I'd like to implement event-pairing filters, similar to Logstash "ellapsed" and "aggregate" filters. Those filters hold events in a buffer before releasing the combined result, therefore such filters might need to return zero event first, then two at once.

f4t avatar Dec 18 '20 02:12 f4t

At the beginning, it's designed to process logs one by one. If you want to handle M inputs and N outputs, M and N are unsigned integers, some interfaces need to be changed.

tsaikd avatar Dec 18 '20 05:12 tsaikd

If you need something to split your input have a look at Gollum, also written in go.

Gollum is an n:m multiplexer that gathers messages from different sources and broadcasts them to a set of destinations.

It will not solve all of your issues but see if you can use it for something.

helgeolav avatar Jun 07 '21 17:06 helgeolav