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!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...