Logstash - if - indexOf

Java
if("str||aaa").indexOf("||")

logstash filter if?

ps. What should I do?

I think this is what you are looking for:

https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#conditionals

You can use the in operator to test whether a field contains a specific string, key, or list element. Note that the semantic meaning of in can vary, based on the target type. For example, when applied to a string. in means "is a substring of". When applied to a collection type, in means "collection contains the exact value".

1 Like

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