Knowledge Management

Why does a search on the "query" field yield different results than on another name like "query_name"?

landen99
Motivator

The following two searches yield very different results:

...|search NOT [...|rename field AS query]
...| rename query AS query_name | search NOT[...|rename field AS query_name]
Tags (1)
0 Karma

landen99
Motivator
...|search NOT [...|rename field AS query]

Does not search the field query, but instead the raw data.
Instead of searching:
NOT(query=value1 OR query=value2 ...)
It searches
NOT(_raw=value1 OR _raw=value2 ...)

If you want to actually search the query field then do this:

   ...| rename query AS query_name |search NOT [...|rename field AS query_name] | rename query_name AS query
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...