Splunk Search

Splunk Stream Case Insensitive Extraction

tjago11
Communicator

Doing an extraction in Splunk Stream and get an error when trying to use (?i) in my regex:

(?i)x-forwarded-for([:\s]+[\d\.:\s,]+)

Gives this error:

Invalid regex Expression

This works fine in a rex command, not sure what the Splunk Stream syntax is for case insensitive. Thanks.

0 Karma
1 Solution

tjago11
Communicator

Ick, I feel dirty but this works.

[xX][-_][fF][oO][rR][wW][aA][rR][dD][eE][dD][-_][fF][oO][rR][:\s]+([\d\.:\s,]+)

I'll not accept this answer yet because it feels gross.

View solution in original post

0 Karma

tjago11
Communicator

Ick, I feel dirty but this works.

[xX][-_][fF][oO][rR][wW][aA][rR][dD][eE][dD][-_][fF][oO][rR][:\s]+([\d\.:\s,]+)

I'll not accept this answer yet because it feels gross.

0 Karma

tjago11
Communicator

Well, I guess the ick answer is better than no answer.

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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