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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...