You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to get the last element of the list, or the second-last element. In other languages like python I can use -1, -2 and so on to get elements from the end of the list. This would be very useful.
scenario:
I have a dns-query log with domains like helpcenter.graylog.com. I want to extract the second level domain (graylog) and the top level domain (com), and save them into another field.
What I did to archive this:
split the field with the split function,
calculate the length of the list, as it could be shorter or longer. Save it in the variable "len"
list_get(list,len - 2) for the second last item, list_get(list,len - 1) for the fields
concat them to save
Step 2+3 would be much easier, if I just could address them with -1 and -2. It's mainly a point of convenienc
What?
I want to get the last element of the list, or the second-last element. In other languages like python I can use -1, -2 and so on to get elements from the end of the list. This would be very useful.
Why?
Support issue request: https://github.com/Graylog2/support/issues/56
scenario:
I have a dns-query log with domains like helpcenter.graylog.com. I want to extract the second level domain (graylog) and the top level domain (com), and save them into another field.
What I did to archive this:
Step 2+3 would be much easier, if I just could address them with -1 and -2. It's mainly a point of convenienc
(created from Zendesk ticket #557)
gz#557
The text was updated successfully, but these errors were encountered: