Split function return a list,How do I get the length of this list?

Before you post: Your responses to these questions will help the community help you. Please complete this template if you’re asking a support question.
Don’t forget to select tags to help index your topic!

1. Describe your incident:
the rule function which name split, return a list,How do I get the length of this list. I want to use this length as a condition.
the length function returns the length of the string, not the list.

3. What steps have you already taken to try and solve the problem?
this is my rule:

rule "test"
    let content = split("|",to_string($message.log));
   let len= length(content) 

4. How can the community help?
Give me an example of calculating the length of a list

Helpful Posting Tips: https:community.graylog.org/t/tips-for-posting-questions-that-get-answers/21828 [Hold down CTRL and link on link to open tips documents in a separate tab]

There is a long-standing request for length():

We now have Length(string) but still nothing for list. Add a comment there to raise visibility - thx.

There is a limited ability to use methods of the Java data types, but this only works for getters:

1 Like

thank you, it is too bad

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