<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using xpath queries on events that contain text and xml in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-xpath-queries-on-events-that-contain-text-and-xml/m-p/91534#M23580</link>
    <description>&lt;P&gt;According to the &lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Xpath" rel="nofollow"&gt;documentation for the xpath comman&lt;/A&gt;d, you should be able to use it on your field as such:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search | xpath field=your_field "//blah/node"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 03 Dec 2010 04:13:26 GMT</pubDate>
    <dc:creator>ftk</dc:creator>
    <dc:date>2010-12-03T04:13:26Z</dc:date>
    <item>
      <title>Using xpath queries on events that contain text and xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-xpath-queries-on-events-that-contain-text-and-xml/m-p/91531#M23577</link>
      <description>&lt;P&gt;Hello,  So xpath feature is great, but I have this issue.  We deal with XML messaging from our customers and would like to extract some field data using xpath queries to run stats.  I was able to create a field extraction that will pull out xml message, but I can't figure out how to tell Splunk to perform the xpath query on an extracted field.  &lt;/P&gt;

&lt;P&gt;Here's what a sample event looks like this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;20101117 161059.999 DEBUG[D] clpr ZZZ:[PROD ZZZ|FIXML3-ReaderThread-105] :CMBSource ZZZ|FIXML3, Underlying Source=[WeblogicJmsSource PROD_XXXX_JMSServer/PROD_XXX!ZZZ_FIXML_IN, TxMode=2] read MessageID 5540635964843910837 --&amp;gt; 
DESTINATION_NAME=
SOURCE_NAME=FIXML3
CORRELATION_ID=5540644259047556424
JMSXDeliveryCount=1
Payload(String)=&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;FIXML&amp;gt;&amp;lt;AllocRptAck MsgEvtSrc="MQM" TxnTm="2010-11-17T16:10:59-06:00" InptDev="API" RptTyp="9" RptID="2" ID="123456" TransTyp="0" TrdDt="2010-11-17"&amp;gt;&amp;lt;Hdr Snt="2010-11-17T16:10:59-06:00"/&amp;gt;&amp;lt;Pty ID="CBT" R="22"&amp;gt;&amp;lt;/Pty&amp;gt;&amp;lt;/AllocAck&amp;gt;&amp;lt;/AllocRptAck&amp;gt;&amp;lt;/FIXML&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I created a field extraction that takes everything between the two FIXML tags and creates a field, but cannot figure out how to execute xpath queries on this in Splunk.  It is a valid XML but how do I tell splunk to just use that field I've identified so that I can use xpath.  Note: xmlkv won't work for this because of the nature of the messages as seen above.  &lt;/P&gt;

&lt;P&gt;Thanks!
-Mike &lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2010 07:18:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-xpath-queries-on-events-that-contain-text-and-xml/m-p/91531#M23577</guid>
      <dc:creator>Mikey_C</dc:creator>
      <dc:date>2010-11-18T07:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using xpath queries on events that contain text and xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-xpath-queries-on-events-that-contain-text-and-xml/m-p/91532#M23578</link>
      <description>&lt;P&gt;I tried to work with XML and xpath but so far without full success. I started to create my own function for it but it's very far to be finished. But this is probably because I'm haven't used the product for a long time.
Have you tried to use rex? For instance, rex (?.*) or something similar to extract what you need.
Hope that helps.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2010 15:47:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-xpath-queries-on-events-that-contain-text-and-xml/m-p/91532#M23578</guid>
      <dc:creator>OL</dc:creator>
      <dc:date>2010-11-18T15:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using xpath queries on events that contain text and xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-xpath-queries-on-events-that-contain-text-and-xml/m-p/91533#M23579</link>
      <description>&lt;P&gt;I know I could write a regular expression to get the field out of the XML, but it would be nice to use xpath queries so I could after different types of data.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2010 01:01:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-xpath-queries-on-events-that-contain-text-and-xml/m-p/91533#M23579</guid>
      <dc:creator>Mikey_C</dc:creator>
      <dc:date>2010-11-19T01:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using xpath queries on events that contain text and xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-xpath-queries-on-events-that-contain-text-and-xml/m-p/91534#M23580</link>
      <description>&lt;P&gt;According to the &lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/Xpath" rel="nofollow"&gt;documentation for the xpath comman&lt;/A&gt;d, you should be able to use it on your field as such:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search | xpath field=your_field "//blah/node"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Dec 2010 04:13:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-xpath-queries-on-events-that-contain-text-and-xml/m-p/91534#M23580</guid>
      <dc:creator>ftk</dc:creator>
      <dc:date>2010-12-03T04:13:26Z</dc:date>
    </item>
  </channel>
</rss>

