<?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: table from xml in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121741#M7129</link>
    <description>&lt;P&gt;Hi SplunkCSIT,&lt;/P&gt;

&lt;P&gt;either setup on your Search Head in &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.2/admin/propsconf"&gt;props.conf&lt;/A&gt; the option &lt;CODE&gt;KV_MODE = xml&lt;/CODE&gt; to have the key=value mapping done or your use &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.2/SearchReference/Spath"&gt;&lt;CODE&gt;spath&lt;/CODE&gt;&lt;/A&gt; to do it on the fly.&lt;/P&gt;

&lt;P&gt;With &lt;CODE&gt;spath&lt;/CODE&gt; it would be like this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Table 1: YourBaseSearchHere | spath | stats values(gerne) AS gerne by id
Table 2: YourBaseSearchHere | spath | stats values(id) AS id by gerne
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or if you did set KV_MODE, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Table 1: YourBaseSearchHere | stats values(gerne) AS gerne by id
Table 2: YourBaseSearchHere | stats values(id) AS id by gerne
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Mon, 07 Apr 2014 10:41:45 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2014-04-07T10:41:45Z</dc:date>
    <item>
      <title>table from xml</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121740#M7128</link>
      <description>&lt;P&gt;Hi, i want to provide two different tables as below&lt;BR /&gt;
Table1:&lt;BR /&gt;
&lt;STRONG&gt;id         Genre&lt;/STRONG&gt;&lt;BR /&gt;
bk1011     Computer &lt;BR /&gt;
bk1121     Computer&lt;BR /&gt;
bk1031     Fantasy&lt;/P&gt;

&lt;P&gt;Table2:&lt;BR /&gt;
&lt;STRONG&gt;Genre     id&lt;/STRONG&gt;&lt;BR /&gt;
Computer  bk1011&lt;BR /&gt;
          bk1121&lt;BR /&gt;
Fantasy   bk1031&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="bk1011"&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-02&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="bk1121"&amp;gt;

      &amp;lt;author&amp;gt;Galos, Mike&amp;lt;/author&amp;gt;
      &amp;lt;title&amp;gt;Visual Studio 7: A Comprehensive Guide&amp;lt;/title&amp;gt;
      &amp;lt;genre&amp;gt;Computer&amp;lt;/genre&amp;gt;
      &amp;lt;price&amp;gt;49.95&amp;lt;/price&amp;gt;
      &amp;lt;publish_date&amp;gt;2001-04-16&amp;lt;/publish_date&amp;gt;
      &amp;lt;description&amp;gt;Microsoft Visual Studio 7 is explored in depth,
      looking at how Visual Basic, Visual C++, C#, and ASP+ are 
      integrated into a comprehensive development 
      environment.&amp;lt;/description&amp;gt;
   &amp;lt;/book&amp;gt;

&amp;lt;book id="bk1031"&amp;gt;

      &amp;lt;author&amp;gt;Corets, Eva&amp;lt;/author&amp;gt;
      &amp;lt;title&amp;gt;Maeve Ascendant&amp;lt;/title&amp;gt;
      &amp;lt;genre&amp;gt;Fantasy&amp;lt;/genre&amp;gt;
      &amp;lt;price&amp;gt;5.95&amp;lt;/price&amp;gt;
      &amp;lt;publish_date&amp;gt;2000-11-17&amp;lt;/publish_date&amp;gt;
      &amp;lt;description&amp;gt;After the collapse of a nanotechnology 
      society in England, the young survivors lay the 
      foundation for a new society.&amp;lt;/description&amp;gt;
   &amp;lt;/book&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Apr 2014 10:08:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121740#M7128</guid>
      <dc:creator>SplunkCSIT</dc:creator>
      <dc:date>2014-04-07T10:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: table from xml</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121741#M7129</link>
      <description>&lt;P&gt;Hi SplunkCSIT,&lt;/P&gt;

&lt;P&gt;either setup on your Search Head in &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.2/admin/propsconf"&gt;props.conf&lt;/A&gt; the option &lt;CODE&gt;KV_MODE = xml&lt;/CODE&gt; to have the key=value mapping done or your use &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.2/SearchReference/Spath"&gt;&lt;CODE&gt;spath&lt;/CODE&gt;&lt;/A&gt; to do it on the fly.&lt;/P&gt;

&lt;P&gt;With &lt;CODE&gt;spath&lt;/CODE&gt; it would be like this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Table 1: YourBaseSearchHere | spath | stats values(gerne) AS gerne by id
Table 2: YourBaseSearchHere | spath | stats values(id) AS id by gerne
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or if you did set KV_MODE, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Table 1: YourBaseSearchHere | stats values(gerne) AS gerne by id
Table 2: YourBaseSearchHere | stats values(id) AS id by gerne
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 10:41:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121741#M7129</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-04-07T10:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: table from xml</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121742#M7130</link>
      <description>&lt;P&gt;Thks for the ans but it does not work. Based on your stats values(gerne) AS gerne by id it returns:&lt;/P&gt;

&lt;P&gt;ID         Genre&lt;BR /&gt;
bk1011     Computer&lt;BR /&gt;
           Fantasy&lt;BR /&gt;
bk1121     Computer&lt;BR /&gt;
           Fantasy&lt;BR /&gt;
bk1031     Computer&lt;BR /&gt;
           Fantasy&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 12:24:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121742#M7130</guid>
      <dc:creator>SplunkCSIT</dc:creator>
      <dc:date>2014-04-07T12:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: table from xml</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121743#M7131</link>
      <description>&lt;P&gt;I can only show you a path to your possible solution, I cannot do your work, since you did not tell what exactly your needs are. Test your data and maybe add some &lt;CODE&gt;dedup gerne&lt;/CODE&gt; before the stats to get what you want....&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 12:33:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121743#M7131</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-04-07T12:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: table from xml</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121744#M7132</link>
      <description>&lt;P&gt;If that entire XML is one event you can do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | spath | rename catalog.book{@id} as id catalog.book.genre as genre | eval id_genre = mvzip(id, genre, "###") | table id_genre | mvexpand id_genre | makemv id_genre delim="###" | eval id = mvindex(id_genre, 0) | eval genre = mvindex(id_genre, 1) | table id genre
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That'll generate your first table. To get the second table from that you can append &lt;CODE&gt;| stats values(id) by genre&lt;/CODE&gt; to the above search.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 12:48:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121744#M7132</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-04-07T12:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: table from xml</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121745#M7133</link>
      <description>&lt;P&gt;thks, it works, now, i want to generate the bar graph such that the x-axis is id, and y-axis is numeric running numbers and the bar is stacked of Genre&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 13:08:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121745#M7133</guid>
      <dc:creator>SplunkCSIT</dc:creator>
      <dc:date>2014-04-07T13:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: table from xml</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121746#M7134</link>
      <description>&lt;P&gt;thks, it works, now, i want to generate the bar graph such that the x-axis is id, and y-axis is numeric running numbers and the bar is stacked of Genre, how to go abt doing it?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2014 00:47:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121746#M7134</guid>
      <dc:creator>SplunkCSIT</dc:creator>
      <dc:date>2014-04-08T00:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: table from xml</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121747#M7135</link>
      <description>&lt;P&gt;Sounds to me as if you'll want to append this instead of the &lt;CODE&gt;stats&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | chart count over id by genre
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...or this, I keep forgetting the order:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | chart count over genre by id
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Apr 2014 07:18:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/table-from-xml/m-p/121747#M7135</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-04-08T07:18:23Z</dc:date>
    </item>
  </channel>
</rss>

