Splunk Search

Are function names case-sensitive?

pm771
Communicator

The following query did not return any results:

... | stats count(EVAL(error_code=2000)) ...

I had to use lower-case eval to make it work.

Is it a general rule or a specific case?

lfedak_splunk
Splunk Employee
Splunk Employee

Hey @pm771 and @sukisen1981, check out the answers and comments on this post: https://answers.splunk.com/answers/46/are-search-language-keywords-case-sensitive.html for some more info.
The free Splunk Fundamentals 1 course also runs through the basics of what is case-sensitive and case-insensitive if you'd like to drill that in. Based on these comments it looks like anything related to stats has to be lowercase at all times.

Sukisen1981
Champion

@lfedak_splunk - thanks for the link. Just to add a bit more. if I do something like
| eval x= .... vs EVAL X=....
results are same
BUT
if I combine it with stats then the upper case EVAL does not work.
So, I guess what @lfedak_splunk says, 'Based on these comments it looks like anything related to stats has to be lowercase at all times.' is the correct answer

pm771
Communicator

@lfedak_splunk:

Is it just stats or timechart as well?

0 Karma

DalJeanis
Legend

@pm771 - all those other verbs are effectively just skins for stats - chart, timechart, eventstats and so on. But, regardless, it's best to stick to lower case for verbs and functions, and upper case for Boolean operators. Home grown functions and macros, use the case you wrote them in.

Sukisen1981
Champion

hmm this is a fantastic question - I tried with my own test data , and you are right.
HOWEVER, i could not find any splunk documentation that explicitly points this out.
Maybe @lfedak_splunk can shed some more light on this?

Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...