Reporting

Use a Special characters

Ant3xes
Engager

Hello,

I want to use the eval search command but i have a little problem.

 

 

 

 

index=* host="*" source="/applis" legs{}.status=* | eval error = if(legs{}.status == 200, "OK", "Problem") | chart count by error

 

 

 

 

When i use legs{}.status field it don't work, i think it's cause of my quotes.

Someone who know how to use that field ?

Thank you and sorry for my bad english

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

You need to put your field name in single quotes if it has a dot in. Try: 

index=* host="*" source="/applis" 'legs{}.status'=* | eval error = if('legs{}.status' == 200, "OK", "Problem") | chart count by error

 

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You need to put your field name in single quotes if it has a dot in. Try: 

index=* host="*" source="/applis" 'legs{}.status'=* | eval error = if('legs{}.status' == 200, "OK", "Problem") | chart count by error

 

0 Karma

Ant3xes
Engager

Thank you ! I only tried with double quotes 😅

0 Karma
Get Updates on the Splunk Community!

Exporting Splunk Apps

Join us on Monday, October 21 at 11 am PT | 2 pm ET!With the app export functionality, app developers and ...

Cisco Use Cases, ITSI Best Practices, and More New Articles from Splunk Lantern

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

Build Your First SPL2 App!

Watch the recording now!.Do you want to SPL™, too? SPL2, Splunk's next-generation data search and preparation ...