Knowledge Management

Field Extractraction problem ??

rakesh_498115
Motivator

Hi .

I have written the following regex in my query , then it is working fine but when i am trying to create this regex expression in the field extractor it is not coming in the query.

My regex expression ::

(?(?im)"(Request|Response)")

Query Used after creating field extractor ::

Sourcetype="mydata" | top Test

but this is not workin ..Please help ..

Tags (1)
0 Karma
1 Solution

lguinn2
Legend

First, the names of fields are case-sensitive. You created a field named "test" but then your top command used a field called "Test". That's never going to work.

Second, although your regular expression may be legal, I would have written it:

(?im)(?<test>"(?:Request|Response)") 

I have noticed that Splunk is sometimes finicky about non-capturing parenthesis; this regular expression is a bit clearer. And are the quotation marks actually in the data? Do you really need them for the regular expression?

View solution in original post

lguinn2
Legend

First, the names of fields are case-sensitive. You created a field named "test" but then your top command used a field called "Test". That's never going to work.

Second, although your regular expression may be legal, I would have written it:

(?im)(?<test>"(?:Request|Response)") 

I have noticed that Splunk is sometimes finicky about non-capturing parenthesis; this regular expression is a bit clearer. And are the quotation marks actually in the data? Do you really need them for the regular expression?

rakesh_498115
Motivator

No quotation marks are not need lginn .. thnx for the regular expression .this worked for me..:)

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