Getting Data In

xpath with splunk

bfaber
Communicator

How compliant is the xpath command with the real xpath? Is there a specific xpath library used?

Tags (2)
1 Solution

gkanapathy
Splunk Employee
Splunk Employee

The Splunk xpath search command uses the Python lxml library http://codespeak.net/lxml/ that is packaged and shipped with the Splunk Python installation. According to its own FAQ http://codespeak.net/lxml/FAQ.html#what-standards-does-lxml-implement it uses Gnome libxml2 and libxslt. I believe these are considered among the most standards-compliant implementations available.

The search command itself is a relatively simple wrapper script that is in $SPLUNK_HOME/etc/apps/search/bin/xpath.py. It is possible to replace or add a different parser by writing a similar script around it. See: http://www.splunk.com/base/Documentation/latest/SearchReference/Aboutcustomsearchcommands

View solution in original post

hvandenb
Path Finder

Phython lib is located http://lxml.de/

0 Karma

gkanapathy
Splunk Employee
Splunk Employee

The Splunk xpath search command uses the Python lxml library http://codespeak.net/lxml/ that is packaged and shipped with the Splunk Python installation. According to its own FAQ http://codespeak.net/lxml/FAQ.html#what-standards-does-lxml-implement it uses Gnome libxml2 and libxslt. I believe these are considered among the most standards-compliant implementations available.

The search command itself is a relatively simple wrapper script that is in $SPLUNK_HOME/etc/apps/search/bin/xpath.py. It is possible to replace or add a different parser by writing a similar script around it. See: http://www.splunk.com/base/Documentation/latest/SearchReference/Aboutcustomsearchcommands

Justin_Grant
Contributor

Wow, great answer!

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...