Splunk Search

How to extract a sequence from this log with rex command

splunk2019tlmd
Engager

I have this log :

        <LST>
      <S>Watch</S>
      <S>Move</S>
      <S>Delete</S>
      <S>Flip</S>
    </LST>

And I want to extract this part with rex syntax :

  <S>Watch</S>
      <S>Move</S>
      <S>Delete</S>
      <S>Flip</S>

But I am not having success , I think is because the specials characters.

Thank you in advance

Tags (2)
0 Karma
1 Solution

to4kawa
Ultra Champion
| rex max_match=0 "(?<attr>\<\w\>\w+\<\/\w\>)"

use \ (back slash)

View solution in original post

to4kawa
Ultra Champion
| rex max_match=0 "(?<attr>\<\w\>\w+\<\/\w\>)"

use \ (back slash)

splunk2019tlmd
Engager

It works but the outputs is one line, in case I want the sequence (Move Delete Flip) ) in one line, I guess I have to replicate the example. Thank you

0 Karma

to4kawa
Ultra Champion
 ....
| eval sequence=mvjoin(attr," ")

try this

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...