How to work with event "message" in Java filter plugin?

Hi,
I am developing a Java Filter Plugin to merge different CSVs, and as I'm trying to process them, I need to extract the message field (which contains the whole CSV line).
How am I supposed to do so using Java language?
The "message" field is the one I want to process later.
image

The filter method provided by Logstash is :

@Override
public Collection<Event> filter(Collection<Event> events, FilterMatchListener matchListener) {
    for (Event e : events) {
        Object f = e.getField(sourceField);
        if (f instanceof String) {
            e.setField(sourceField, StringUtils.reverse((String)f));
            **//Here I would implement logic to generate CSV files** 
            matchListener.filterMatched(e);
        }
    }
    return events;

I am trying to do something like filewriter.write(messageField) and then I am planning on processing the new generated CSV files.

Thank you!

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