Splunk Search

What is the usage of "(?msi)" in Splunk with rex comamnd?

admin12345678
Path Finder

Hi,
I am having some problem to understand the usage of "(?msi)" with rex command,please help me regarding that?

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @admin12345678,
as you can see in regex101 the meaning of (?msi) is:

(?msi) match the remainder of the pattern with the following effective flags: gmsi
m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string)
s modifier: single line. Dot matches newline characters
i modifier: insensitive. Case insensitive match (ignores case of [a-zA-Z])

Ciao.
Giuseppe

0 Karma

admin12345678
Path Finder

Thanks @gcusello, can you please explain me more about the m modifier?

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @admin12345678,
you have to use the m modifier when you have a multi line log (e.g. wineventlog).

The best approach is to use it in regex101, e.g. with a wineventlog sample.

Ciao.
Giuseppe

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...