<?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: extract xml field in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116255#M6686</link>
    <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;take a look at the &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.2/SearchReference/Spath"&gt;spath&lt;/A&gt; command, this will take care of XML/JSON data and extract the &lt;CODE&gt;key=value&lt;/CODE&gt; for you.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Wed, 02 Apr 2014 11:09:12 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2014-04-02T11:09:12Z</dc:date>
    <item>
      <title>extract xml field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116254#M6685</link>
      <description>&lt;P&gt;i'm new to xml, need help on the following: I got alot of catalogs and some catalog got more books and some got less books. Below is the example of one of the catalog. For this catalog, i got two books and each book have its own key=value that belong to its book. What would be the best approach to extract the key-values pair for each book for each catalog.&lt;BR /&gt;
thks&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0"?&amp;gt;

   &amp;lt;catalog&amp;gt;

    &amp;lt;book id="bk101"&amp;gt;
      &amp;lt;author&amp;gt;Gambardella, Matthew&amp;lt;/author&amp;gt;
      &amp;lt;title&amp;gt;XML Developer's Guide&amp;lt;/title&amp;gt;
      &amp;lt;genre&amp;gt;Computer&amp;lt;/genre&amp;gt;
      &amp;lt;price&amp;gt;44.95&amp;lt;/price&amp;gt;
      &amp;lt;publish_date&amp;gt;2000-10-01&amp;lt;/publish_date&amp;gt;
      &amp;lt;description&amp;gt;An in-depth look at creating applications 
      with XML.&amp;lt;/description&amp;gt;
     &amp;lt;/book&amp;gt;

    &amp;lt;book id="bk101"&amp;gt;
      &amp;lt;author&amp;gt;Gambardella, Matthew&amp;lt;/author&amp;gt;
      &amp;lt;title&amp;gt;XML Developer's Guide&amp;lt;/title&amp;gt;
      &amp;lt;genre&amp;gt;Computer&amp;lt;/genre&amp;gt;
      &amp;lt;price&amp;gt;44.95&amp;lt;/price&amp;gt;
      &amp;lt;publish_date&amp;gt;2000-10-01&amp;lt;/publish_date&amp;gt;
      &amp;lt;description&amp;gt;An in-depth look at creating applications 
      with XML.&amp;lt;/description&amp;gt;
     &amp;lt;/book&amp;gt;


  &amp;lt;/catalog&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Apr 2014 09:21:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116254#M6685</guid>
      <dc:creator>SplunkCSIT</dc:creator>
      <dc:date>2014-04-02T09:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: extract xml field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116255#M6686</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;take a look at the &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.2/SearchReference/Spath"&gt;spath&lt;/A&gt; command, this will take care of XML/JSON data and extract the &lt;CODE&gt;key=value&lt;/CODE&gt; for you.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2014 11:09:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116255#M6686</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-04-02T11:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: extract xml field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116256#M6687</link>
      <description>&lt;P&gt;or you set the &lt;CODE&gt;KV_MODE=xml&lt;/CODE&gt; for your source/sourcetype in &lt;CODE&gt;props.conf&lt;/CODE&gt; &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.2/Admin/Propsconf"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.2/Admin/Propsconf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2014 11:32:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116256#M6687</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-04-02T11:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: extract xml field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116257#M6688</link>
      <description>&lt;P&gt;thks a lot, how to create the table such to show unique author if the the author had more than 1 title? thks&lt;/P&gt;

&lt;P&gt;author                      Title&lt;BR /&gt;
Gambardella, Matthew        XML Developer's Guide&lt;BR /&gt;
                            XML Developer's Guide1&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2014 13:33:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116257#M6688</guid>
      <dc:creator>SplunkCSIT</dc:creator>
      <dc:date>2014-04-02T13:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: extract xml field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116258#M6689</link>
      <description>&lt;P&gt;&lt;CODE&gt;YourBaseSearchHere | chart values(Title) as Title by author&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;and please tick the tick to mark this as answered, you can also upvote it &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2014 13:47:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116258#M6689</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-04-02T13:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: extract xml field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116259#M6690</link>
      <description>&lt;P&gt;KV_MODE=xml for your source/sourcetype in props.conf is to be configure at forwarder end or indexer end? thks&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 01:02:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116259#M6690</guid>
      <dc:creator>SplunkCSIT</dc:creator>
      <dc:date>2014-04-03T01:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: extract xml field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116260#M6691</link>
      <description>&lt;P&gt;this is &lt;CODE&gt;search&lt;/CODE&gt; related and therefore it goes into &lt;CODE&gt;props.conf&lt;/CODE&gt; on the indexer, see &lt;A href="http://wiki.splunk.com/Where_do_I_configure_my_Splunk_settings%3F"&gt;http://wiki.splunk.com/Where_do_I_configure_my_Splunk_settings%3F&lt;/A&gt; for more detailed informations&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 06:48:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116260#M6691</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-04-03T06:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: extract xml field</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116261#M6692</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="&amp;lt;?xml version=\"1.0\"&amp;gt;

    &amp;lt;catalog&amp;gt;

     &amp;lt;book id=\"bk101\"&amp;gt;
       &amp;lt;author&amp;gt;Gambardella, Matthew&amp;lt;/author&amp;gt;
       &amp;lt;title&amp;gt;XML Developer's Guide&amp;lt;/title&amp;gt;
       &amp;lt;genre&amp;gt;Computer&amp;lt;/genre&amp;gt;
       &amp;lt;price&amp;gt;44.95&amp;lt;/price&amp;gt;
       &amp;lt;publish_date&amp;gt;2000-10-01&amp;lt;/publish_date&amp;gt;
       &amp;lt;description&amp;gt;An in-depth look at creating applications 
       with XML.&amp;lt;/description&amp;gt;
      &amp;lt;/book&amp;gt;

     &amp;lt;book id=\"bk101\"&amp;gt;
       &amp;lt;author&amp;gt;Gambardella, Matthew&amp;lt;/author&amp;gt;
       &amp;lt;title&amp;gt;XML Developer's Guide&amp;lt;/title&amp;gt;
       &amp;lt;genre&amp;gt;Computer&amp;lt;/genre&amp;gt;
       &amp;lt;price&amp;gt;44.95&amp;lt;/price&amp;gt;
       &amp;lt;publish_date&amp;gt;2000-10-01&amp;lt;/publish_date&amp;gt;
       &amp;lt;description&amp;gt;An in-depth look at creating applications 
       with XML.&amp;lt;/description&amp;gt;
      &amp;lt;/book&amp;gt;


   &amp;lt;/catalog&amp;gt;"
| spath
| rename catalog.book.* as *
| rename "catalog.book{@id}" as id
| eval counter=mvrange(1,mvcount(id) + 1)
| stats values(*) as * by counter
| table id author title genre price publish_date description
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this case, you can expand with this query.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 09:48:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/extract-xml-field/m-p/116261#M6692</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-07T09:48:18Z</dc:date>
    </item>
  </channel>
</rss>

