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!

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, ...