Splunk Enterprise Security

Splunk Query related

rupesh67nikam
New Member

I've written below query,

index=* sourcetype=* EventCode=* | rex field=_raw "((Process Command Line:\t)(?(.+)*))" |stats count by field.

Tried extracting "Process Command line" field. After extracting i can see that though it doesn't contain any value(not even spaces), Splunk is not taking it as NULL.Instead it is taking as if field has some command line.

Could you please help?

0 Karma

vikcee
Path Finder

Please Provide the Sample log, So that we can see if is there any issue with rex or something else.

Normally rex syntax is like below.
(?<Field_Name>Regular_Expression)

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @rupesh67nikam,
I cannot read you search, you should insert it in Sample Code.

Anyway, in your regex I see spaces in field name (but could be a visualization error) and it's better not use them.
Then in stats count BY field command, you should use a field name (not field), e.g. something like

| stats count by Process_Command_Line

or

| stats count by "Process Command Line"

Ciao.
Giuseppe

0 Karma

Sukisen1981
Champion

could you please provide samples of your raw event and what you want to extract out of that?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...