Splunk Search

Can I use kv_mode = auto AND kv_mode = XML for sourcetype?

tyronetv
Communicator

I have an application sourcetype that is a mix of normal informational data and also houses a subset of web requests and web responses all in XML format.

I would like to present the XML data as a searchable element, i.e, account=1234, while at the same time allowing the current key/value pairs to be searched.

As I read the docs, kv_mode is basically all or nothing. In that, it's one mode only.

How would I go about capturing both field elements from my logs using the splunk field identification process and not having to write thousands of extract statements?

Tags (3)
0 Karma
1 Solution

lguinn2
Legend

If you want to use Splunk's automatic extraction capabilities, you have to pick one or the other. But - you could split your data into two sourcetypes. For example, instead of mysourcetype, use mysourcetype-XML and mysourcetype-KV. Then your searches could look for sourcetype=mysourcetype* to get both types of data.

Generally, a sourcetype contains data that is syntactically homogeneous, as much as possible.

Another alternative is to use the xmlkv command to parse the XML fields during execution of a particular search.

View solution in original post

0 Karma

lguinn2
Legend

If you want to use Splunk's automatic extraction capabilities, you have to pick one or the other. But - you could split your data into two sourcetypes. For example, instead of mysourcetype, use mysourcetype-XML and mysourcetype-KV. Then your searches could look for sourcetype=mysourcetype* to get both types of data.

Generally, a sourcetype contains data that is syntactically homogeneous, as much as possible.

Another alternative is to use the xmlkv command to parse the XML fields during execution of a particular search.

0 Karma
Get Updates on the Splunk Community!

Splunk Lantern | Getting Started with Edge Processor, Machine Learning Toolkit ...

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

Enterprise Security Content Update (ESCU) | New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 2 releases of new security content via the ...

Announcing the 1st Round Champion’s Tribute Winners of the Great Resilience Quest

We are happy to announce the 20 lucky questers who are selected to be the first round of Champion's Tribute ...