Splunk Search

How does automatic key=value extraction works?

tpaulsen
Contributor

Hello,

we have a logfile that contains key=value pairs.
Usually Splunks automatic field extraction is working fine and is showing the fields. But...when i want to do a search like e.g. this:

source="/var/opt/tomcat/logs/san.log" tag="*"

Splunk tells me, that the field "tag" doesn´t exist.

But when i use:

source="/var/opt/tomcat/logs/san.log" | search tag="whateverilookfor*"

i get the results as wished but also a message on top of the window saying:

Encountered an unexpected error while
parsing intentions.

What is happening here and how can i avoid this?

1 Solution

kristian_kolb
Ultra Champion

tag is probably a reserved word, since it refers to tagging of information. See the Knowledge Manager section in the docs.

Maybe that only applies when it comes before the first pipe. However, I believe that

source="/var/opt/tomcat/logs/san.log" "tag=*"

would give you what you want, i.e. enclosing the statement in double quotes.

Hope this helps,

Kristian

View solution in original post

kristian_kolb
Ultra Champion

tag is probably a reserved word, since it refers to tagging of information. See the Knowledge Manager section in the docs.

Maybe that only applies when it comes before the first pipe. However, I believe that

source="/var/opt/tomcat/logs/san.log" "tag=*"

would give you what you want, i.e. enclosing the statement in double quotes.

Hope this helps,

Kristian

tpaulsen
Contributor

Thank you Kristian, that was exactly the problem. Tag is a reserved word, so it shouldn´t be used in the Logevent as a fieldname. We change the fieldname to ltag, now it is working. Best, Thomas

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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...