Splunk Cloud

Search Reference

Download manual as PDF

Download topic as PDF

xmlkv

Description

The xmlkv command automatically extracts fields from XML-formatted data. For example, if the XML contains the following in its _raw data: <foo>bar</foo>, foo is the key and bar is the value.

For JSON-formatted data, use the spath command.

Syntax

xmlkv maxinputs=<int>

Required arguments

maxinputs
Syntax: maxinputs=<int>
Description: The maximum number of inputs.


Examples

Example 1: Automatically extract fields from XML tags.

... | xmlkv

Example 2: Extract the key-value pairs from the first ten thousand events.

... | xmlkv maxinputs=10000

See also

extract, kvform, multikv, rex, spath, xpath

Answers

Have questions? Visit Splunk Answers and see what questions and answers the Splunk community has using the xmlkv command.

PREVIOUS
x11
  NEXT
xmlunescape

This documentation applies to the following versions of Splunk Cloud: 6.5.0, 6.5.1, 6.5.1612, 6.6.0, 6.6.1, 6.6.3


Was this documentation topic helpful?

Enter your email address, and someone from the documentation team will respond to you:

Please provide your comments here. Ask a question or make a suggestion.

You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters