<?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 How can I create a table of results from my XML data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-table-of-results-from-my-XML-data/m-p/180697#M52064</link>
    <description>&lt;P&gt;Given the following event log XML (sample) data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8" standalone="no"?&amp;gt;
&amp;lt;!--This file represents the results of running a test suite--&amp;gt;
&amp;lt;test-results total="2" errors="0" failures="1" not-run="2" inconclusive="0" ignored="2" skipped="0" invalid="0" date="2015-08-18" time="12:36:04"&amp;gt;
  &amp;lt;test-suite type="Assembly" name="Smoke.Tests.dll" executed="True" result="Failure" success="False" time="40.000" asserts="0"&amp;gt;
    &amp;lt;results&amp;gt;
      &amp;lt;test-suite type="Namespace" name="MyTestSuite" executed="True" result="Failure" success="False" time="40.000" asserts="0"&amp;gt;
        &amp;lt;results&amp;gt;
          &amp;lt;test-suite type="TestFixture" name="Feature1" description="Description1" executed="True" result="Success" time="20.000"&amp;gt;
            &amp;lt;results&amp;gt;
              &amp;lt;test-case name="Test1" description="TestDescription1" executed="True" result="Success"/&amp;gt;
            &amp;lt;/results&amp;gt;
          &amp;lt;/test-suite&amp;gt;
          &amp;lt;test-suite type="TestFixture" name="Feature2" description="Description2" executed="False" result="Ignored"&amp;gt;
            &amp;lt;results&amp;gt;
              &amp;lt;test-case name="Test2" description="TestDescription2" executed="False" result="Ignored"/&amp;gt;
            &amp;lt;/results&amp;gt;
          &amp;lt;/test-suite&amp;gt;
          &amp;lt;test-suite type="TestFixture" name="Feature3" description="Description3" executed="True" result="Fail" time="20.000"&amp;gt;
            &amp;lt;results&amp;gt;
              &amp;lt;test-case name="Test3" description="TestDescription3" executed="True" result="Fail"/&amp;gt;
            &amp;lt;/results&amp;gt;
          &amp;lt;/test-suite&amp;gt;
          &amp;lt;test-suite type="TestFixture" name="Feature14" description="Description4" executed="False" result="Ignored"&amp;gt;
            &amp;lt;results&amp;gt;
              &amp;lt;test-case name="Test4" description="TestDescription4" executed="False" result="Ignored"/&amp;gt;
              &amp;lt;test-case name="Test5" description="TestDescription5" executed="False" result="Ignored"/&amp;gt;
              &amp;lt;test-case name="Test6" description="TestDescription6" executed="False" result="Ignored"/&amp;gt;
            &amp;lt;/results&amp;gt;
          &amp;lt;/test-suite&amp;gt;
        &amp;lt;/results&amp;gt;
      &amp;lt;/test-suite&amp;gt;
    &amp;lt;/results&amp;gt;
  &amp;lt;/test-suite&amp;gt;
&amp;lt;/test-results&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is it possible to generate 2 tables of results similar to that below (includes 'group' data too) for only those Test Fixtures where executed=True:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Name          Description     Result      TimeTaken
Feature1      Description1    Success      20.000
Feature3      Description3    Fail         20.000

Date        Time          Ran       Ignored   Failed  Errored  TotalTime
2015-08-18  12:36:04      2         2          1       0        40.000
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 19 Aug 2015 07:46:47 GMT</pubDate>
    <dc:creator>GadgetGeek</dc:creator>
    <dc:date>2015-08-19T07:46:47Z</dc:date>
    <item>
      <title>How can I create a table of results from my XML data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-table-of-results-from-my-XML-data/m-p/180697#M52064</link>
      <description>&lt;P&gt;Given the following event log XML (sample) data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8" standalone="no"?&amp;gt;
&amp;lt;!--This file represents the results of running a test suite--&amp;gt;
&amp;lt;test-results total="2" errors="0" failures="1" not-run="2" inconclusive="0" ignored="2" skipped="0" invalid="0" date="2015-08-18" time="12:36:04"&amp;gt;
  &amp;lt;test-suite type="Assembly" name="Smoke.Tests.dll" executed="True" result="Failure" success="False" time="40.000" asserts="0"&amp;gt;
    &amp;lt;results&amp;gt;
      &amp;lt;test-suite type="Namespace" name="MyTestSuite" executed="True" result="Failure" success="False" time="40.000" asserts="0"&amp;gt;
        &amp;lt;results&amp;gt;
          &amp;lt;test-suite type="TestFixture" name="Feature1" description="Description1" executed="True" result="Success" time="20.000"&amp;gt;
            &amp;lt;results&amp;gt;
              &amp;lt;test-case name="Test1" description="TestDescription1" executed="True" result="Success"/&amp;gt;
            &amp;lt;/results&amp;gt;
          &amp;lt;/test-suite&amp;gt;
          &amp;lt;test-suite type="TestFixture" name="Feature2" description="Description2" executed="False" result="Ignored"&amp;gt;
            &amp;lt;results&amp;gt;
              &amp;lt;test-case name="Test2" description="TestDescription2" executed="False" result="Ignored"/&amp;gt;
            &amp;lt;/results&amp;gt;
          &amp;lt;/test-suite&amp;gt;
          &amp;lt;test-suite type="TestFixture" name="Feature3" description="Description3" executed="True" result="Fail" time="20.000"&amp;gt;
            &amp;lt;results&amp;gt;
              &amp;lt;test-case name="Test3" description="TestDescription3" executed="True" result="Fail"/&amp;gt;
            &amp;lt;/results&amp;gt;
          &amp;lt;/test-suite&amp;gt;
          &amp;lt;test-suite type="TestFixture" name="Feature14" description="Description4" executed="False" result="Ignored"&amp;gt;
            &amp;lt;results&amp;gt;
              &amp;lt;test-case name="Test4" description="TestDescription4" executed="False" result="Ignored"/&amp;gt;
              &amp;lt;test-case name="Test5" description="TestDescription5" executed="False" result="Ignored"/&amp;gt;
              &amp;lt;test-case name="Test6" description="TestDescription6" executed="False" result="Ignored"/&amp;gt;
            &amp;lt;/results&amp;gt;
          &amp;lt;/test-suite&amp;gt;
        &amp;lt;/results&amp;gt;
      &amp;lt;/test-suite&amp;gt;
    &amp;lt;/results&amp;gt;
  &amp;lt;/test-suite&amp;gt;
&amp;lt;/test-results&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is it possible to generate 2 tables of results similar to that below (includes 'group' data too) for only those Test Fixtures where executed=True:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Name          Description     Result      TimeTaken
Feature1      Description1    Success      20.000
Feature3      Description3    Fail         20.000

Date        Time          Ran       Ignored   Failed  Errored  TotalTime
2015-08-18  12:36:04      2         2          1       0        40.000
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Aug 2015 07:46:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-table-of-results-from-my-XML-data/m-p/180697#M52064</guid>
      <dc:creator>GadgetGeek</dc:creator>
      <dc:date>2015-08-19T07:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a table of results from my XML data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-table-of-results-from-my-XML-data/m-p/180698#M52065</link>
      <description>&lt;P&gt;I can generate the summary results using the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="xml" | spath output="Total" path=test-results.test-suite{1}{@time} | rename total as "Ran" |  rename success as "Overall Result" | table date, time, "Ran",  ignored, failures, errors, "TotalTime"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(Please ignore the namings of the headers) &lt;BR /&gt;
As these fileds are automatically generated by Splunk (I assume from the processing of the first 5000 chars of the file - though I can't get to any Splunk Server config files).&lt;/P&gt;</description>
      <pubDate>Wed, 19 Aug 2015 08:41:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-table-of-results-from-my-XML-data/m-p/180698#M52065</guid>
      <dc:creator>GadgetGeek</dc:creator>
      <dc:date>2015-08-19T08:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a table of results from my XML data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-table-of-results-from-my-XML-data/m-p/180699#M52066</link>
      <description>&lt;P&gt;Two things you need to consider.&lt;/P&gt;

&lt;P&gt;1) spath has an extraction cutoff that its default is the first 5000 bytes. So if your XML event is greater than 5000 bytes. spath will not  extract all fields.&lt;BR /&gt;
2) It your event is greater than 10K characters. You need to assure that the whole event is ingested and not truncated.&lt;/P&gt;

&lt;P&gt;To address these two cases you could use the following configuration files:&lt;/P&gt;

&lt;P&gt;1) /opt/splunk/etc/system/local/inputs.conf&lt;/P&gt;

&lt;P&gt;[your_sourcetype_name]&lt;BR /&gt;
TRUNCATE = 0&lt;/P&gt;

&lt;P&gt;2) /opt/splunk/etc/system/local/limits.conf&lt;/P&gt;

&lt;P&gt;[spath]&lt;BR /&gt;
extraction_cutoff = 10000&lt;/P&gt;

&lt;P&gt;Then, restart splunk.&lt;/P&gt;

&lt;P&gt;I hope it helps...&lt;BR /&gt;
Lp&lt;/P&gt;

&lt;P&gt;For more information&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.5/Admin/Limitsconf" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.5/Admin/Limitsconf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.5/Admin/Inputsconf" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.5/Admin/Inputsconf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:07:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-table-of-results-from-my-XML-data/m-p/180699#M52066</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2020-09-29T07:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a table of results from my XML data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-table-of-results-from-my-XML-data/m-p/180700#M52067</link>
      <description>&lt;P&gt;I've read about this, and did mention the 5000 limit in my last comment. However, as useful as this is, it is not an answer to the question.&lt;/P&gt;

&lt;P&gt;The question is how to obtain multiple XML query results (i.e. from multiple elements that match the query) from a each single XML event log and display them as a table.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2015 06:21:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-create-a-table-of-results-from-my-XML-data/m-p/180700#M52067</guid>
      <dc:creator>GadgetGeek</dc:creator>
      <dc:date>2015-08-25T06:21:05Z</dc:date>
    </item>
  </channel>
</rss>

