<?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: Query with xpath in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Query-with-xpath/m-p/253857#M75993</link>
    <description>&lt;P&gt;I cant I am sorry as it contains confidential information.&lt;BR /&gt;
The section of concern is as above and the text that I am trying to extract is contained in no other section that that above.&lt;/P&gt;

&lt;P&gt;For some reason the escaping XML is being removed.. will try to past again&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;_0:Organisation key="INTERMEDIARY_ORG_001"&amp;gt;
        &amp;lt;_0:MailingAddress addressReference="INTERMEDIARY_ADDRESS_001"/&amp;gt;
        &amp;lt;_0:OrganisationName&amp;gt;
          &amp;lt;_0:TypeCode&amp;gt;CommonName&amp;lt;/_0:TypeCode&amp;gt;
          &amp;lt;_0:FullName&amp;gt;GARATY MURNANE - SME TRANSFER&amp;lt;/_0:FullName&amp;gt;
        &amp;lt;/_0:OrganisationName&amp;gt;
      &amp;lt;/_0:Organisation&amp;gt;
      &amp;lt;_0:Organisation key="INSURED_ORG_001"&amp;gt;
        &amp;lt;_0:MailingAddress addressReference="INSURED_ADDRESS_001"/&amp;gt;
        &amp;lt;_0:AustralianTaxInformation&amp;gt;
          &amp;lt;_0:GSTRegistered&amp;gt;false&amp;lt;/_0:GSTRegistered&amp;gt;
        &amp;lt;/_0:AustralianTaxInformation&amp;gt;
        &amp;lt;_0:OrganisationName&amp;gt;
          &amp;lt;_0:TypeCode&amp;gt;CommonName&amp;lt;/_0:TypeCode&amp;gt;
          &amp;lt;_0:FullName&amp;gt;CDA Investments Pty Ltd&amp;lt;/_0:FullName&amp;gt;
        &amp;lt;/_0:OrganisationName&amp;gt;
        &amp;lt;_0:OrganisationName&amp;gt;
          &amp;lt;_0:TypeCode&amp;gt;TradingName&amp;lt;/_0:TypeCode&amp;gt;
          &amp;lt;_0:FullName&amp;gt;CDA Investments Pty Ltd&amp;lt;/_0:FullName&amp;gt;
        &amp;lt;/_0:OrganisationName&amp;gt;
      &amp;lt;/_0:Organisation&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can use xpath with out issues to extract other sections of the xml it is just the above giving me grief as there is no unique key for each section.&lt;/P&gt;

&lt;P&gt;Cheers&lt;/P&gt;

&lt;P&gt;Alastair&lt;/P&gt;</description>
    <pubDate>Wed, 31 Aug 2016 01:51:35 GMT</pubDate>
    <dc:creator>ahogbin</dc:creator>
    <dc:date>2016-08-31T01:51:35Z</dc:date>
    <item>
      <title>Query with xpath</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-with-xpath/m-p/253855#M75991</link>
      <description>&lt;P&gt;I am slowly progressing on a report but I am stuck on trying to extract some values from xml.&lt;/P&gt;

&lt;P&gt;The values I am trying to get are contained within&lt;BR /&gt;
    &amp;lt;_0:Organisation key="INTERMEDIARY_ORG_001"&amp;gt;&lt;BR /&gt;
            &amp;lt;_0:MailingAddress addressReference="INTERMEDIARY_ADDRESS_001"/&amp;gt;&lt;BR /&gt;
            &amp;lt;_0:OrganisationName&amp;gt;&lt;BR /&gt;
              &amp;lt;_0:TypeCode&amp;gt;CommonName&amp;lt;/_0:TypeCode&amp;gt;&lt;BR /&gt;
              &amp;lt;_0:FullName&amp;gt;&lt;STRONG&gt;Text Values example 1&lt;/STRONG&gt;&amp;lt;/_0:FullName&amp;gt;&lt;BR /&gt;
            &amp;lt;/_0:OrganisationName&amp;gt;&lt;BR /&gt;
          &amp;lt;/_0:Organisation&amp;gt;&lt;BR /&gt;
          &amp;lt;_0:Organisation key="INSURED_ORG_001"&amp;gt;&lt;BR /&gt;
            &amp;lt;_0:MailingAddress addressReference="INSURED_ADDRESS_001"/&amp;gt;&lt;BR /&gt;
            &amp;lt;_0:AustralianTaxInformation&amp;gt;&lt;BR /&gt;
              &amp;lt;_0:GSTRegistered&amp;gt;false&amp;lt;/_0:GSTRegistered&amp;gt;&lt;BR /&gt;
            &amp;lt;/_0:AustralianTaxInformation&amp;gt;&lt;BR /&gt;
            &amp;lt;_0:OrganisationName&amp;gt;&lt;BR /&gt;
              &amp;lt;_0:TypeCode&amp;gt;CommonName&amp;lt;/_0:TypeCode&amp;gt;&lt;BR /&gt;
              &amp;lt;_0:FullName&amp;gt;&lt;STRONG&gt;Text value item 2&lt;/STRONG&gt;&amp;lt;/_0:FullName&amp;gt;&lt;BR /&gt;
            &amp;lt;/_0:OrganisationName&amp;gt;&lt;BR /&gt;
            &amp;lt;_0:OrganisationName&amp;gt;&lt;BR /&gt;
              &amp;lt;_0:TypeCode&amp;gt;TradingName&amp;lt;/_0:TypeCode&amp;gt;&lt;BR /&gt;
              &amp;lt;_0:FullName&amp;gt;&lt;STRONG&gt;Text value item 2&lt;/STRONG&gt;&amp;lt;/_0:FullName&amp;gt;&lt;BR /&gt;
            &amp;lt;/_0:OrganisationName&amp;gt;&lt;BR /&gt;
          &amp;lt;/_0:Organisation&amp;gt;&lt;/P&gt;

&lt;P&gt;The values I am trying to get are &lt;STRONG&gt;Text Values example 1&lt;/STRONG&gt; and &lt;STRONG&gt;Text value item 2&lt;/STRONG&gt; (the second string appears twice but I am happy with either.&lt;/P&gt;

&lt;P&gt;I am using xpath command &lt;/P&gt;

&lt;P&gt;Somesearch stuff   | xpath outfield=test1 "//&lt;EM&gt;[local-name()='Organisation' and *[local-name()='TypeCode']]/&lt;/EM&gt;[local-name()='FullName']" | table test1&lt;/P&gt;

&lt;P&gt;But not getting any results. I think the issue is to do with the fact that TypeCode is no unique but I am not sure how you can/could include the CommonName / TradingName as a key.&lt;/P&gt;

&lt;P&gt;Help would greatly appreciated.&lt;/P&gt;

&lt;P&gt;Thanks as always&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:46:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-with-xpath/m-p/253855#M75991</guid>
      <dc:creator>ahogbin</dc:creator>
      <dc:date>2020-09-29T10:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Query with xpath</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-with-xpath/m-p/253856#M75992</link>
      <description>&lt;P&gt;post the full xml.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2016 15:12:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-with-xpath/m-p/253856#M75992</guid>
      <dc:creator>vasanthmss</dc:creator>
      <dc:date>2016-08-30T15:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Query with xpath</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-with-xpath/m-p/253857#M75993</link>
      <description>&lt;P&gt;I cant I am sorry as it contains confidential information.&lt;BR /&gt;
The section of concern is as above and the text that I am trying to extract is contained in no other section that that above.&lt;/P&gt;

&lt;P&gt;For some reason the escaping XML is being removed.. will try to past again&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;_0:Organisation key="INTERMEDIARY_ORG_001"&amp;gt;
        &amp;lt;_0:MailingAddress addressReference="INTERMEDIARY_ADDRESS_001"/&amp;gt;
        &amp;lt;_0:OrganisationName&amp;gt;
          &amp;lt;_0:TypeCode&amp;gt;CommonName&amp;lt;/_0:TypeCode&amp;gt;
          &amp;lt;_0:FullName&amp;gt;GARATY MURNANE - SME TRANSFER&amp;lt;/_0:FullName&amp;gt;
        &amp;lt;/_0:OrganisationName&amp;gt;
      &amp;lt;/_0:Organisation&amp;gt;
      &amp;lt;_0:Organisation key="INSURED_ORG_001"&amp;gt;
        &amp;lt;_0:MailingAddress addressReference="INSURED_ADDRESS_001"/&amp;gt;
        &amp;lt;_0:AustralianTaxInformation&amp;gt;
          &amp;lt;_0:GSTRegistered&amp;gt;false&amp;lt;/_0:GSTRegistered&amp;gt;
        &amp;lt;/_0:AustralianTaxInformation&amp;gt;
        &amp;lt;_0:OrganisationName&amp;gt;
          &amp;lt;_0:TypeCode&amp;gt;CommonName&amp;lt;/_0:TypeCode&amp;gt;
          &amp;lt;_0:FullName&amp;gt;CDA Investments Pty Ltd&amp;lt;/_0:FullName&amp;gt;
        &amp;lt;/_0:OrganisationName&amp;gt;
        &amp;lt;_0:OrganisationName&amp;gt;
          &amp;lt;_0:TypeCode&amp;gt;TradingName&amp;lt;/_0:TypeCode&amp;gt;
          &amp;lt;_0:FullName&amp;gt;CDA Investments Pty Ltd&amp;lt;/_0:FullName&amp;gt;
        &amp;lt;/_0:OrganisationName&amp;gt;
      &amp;lt;/_0:Organisation&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can use xpath with out issues to extract other sections of the xml it is just the above giving me grief as there is no unique key for each section.&lt;/P&gt;

&lt;P&gt;Cheers&lt;/P&gt;

&lt;P&gt;Alastair&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 01:51:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-with-xpath/m-p/253857#M75993</guid>
      <dc:creator>ahogbin</dc:creator>
      <dc:date>2016-08-31T01:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Query with xpath</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-with-xpath/m-p/253858#M75994</link>
      <description>&lt;P&gt;please check this -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Somesearch stuff | xpath outfield=test1 "//[local-name()='Organisation']/*[local-name()='FullName']" | table test1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;maybe, rex would do it - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Somesearch stuff | rex field=_raw "FullName\&amp;gt;"(?&amp;lt;fullnamerex&amp;gt;\w+[^\&amp;lt;])" | dedup fullnamerex | table test1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Aug 2016 06:31:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-with-xpath/m-p/253858#M75994</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-08-31T06:31:18Z</dc:date>
    </item>
  </channel>
</rss>

