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!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...