<?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: How to use xunit files? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-xunit-files/m-p/57043#M3032</link>
    <description>&lt;P&gt;Thanks! We ended up defining an xunit source type which is working nicely- thanks!&lt;/P&gt;

&lt;P&gt;Yaron&lt;/P&gt;</description>
    <pubDate>Sat, 22 Dec 2012 06:18:38 GMT</pubDate>
    <dc:creator>kretch</dc:creator>
    <dc:date>2012-12-22T06:18:38Z</dc:date>
    <item>
      <title>How to use xunit files?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-xunit-files/m-p/57041#M3030</link>
      <description>&lt;P&gt;Hi There&lt;BR /&gt;
I'm very new to splunk, and am trying to find pointers on how to index xunit files (generated from some nose unit tests). A typical xunit file looks like this&lt;BR /&gt;
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;BR /&gt;
&lt;TESTSUITE name="nosetests" tests="1" errors="1" failures="0" skip="0"&gt;&lt;BR /&gt;
    &lt;TESTCASE classname="path_to_test_suite.TestSomething"&gt;&lt;BR /&gt;
              name="test_it" time="0"&amp;gt;&lt;BR /&gt;
        &lt;ERROR type="exceptions.TypeError" message="oops, wrong type"&gt;&lt;BR /&gt;
        Traceback (most recent call last):&lt;BR /&gt;
        ...&lt;BR /&gt;
        TypeError: oops, wrong type&lt;BR /&gt;
        &lt;/ERROR&gt;&lt;BR /&gt;
    &lt;/TESTCASE&gt;&lt;BR /&gt;
&lt;/TESTSUITE&gt;&lt;/P&gt;

&lt;P&gt;How would I go about indexing those files?&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Yaron&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2012 07:42:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-xunit-files/m-p/57041#M3030</guid>
      <dc:creator>kretch</dc:creator>
      <dc:date>2012-12-07T07:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to use xunit files?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-xunit-files/m-p/57042#M3031</link>
      <description>&lt;P&gt;First, Splunk needs to know very little about a file in order to index it or search it. Basically, if you can point Splunk at the file and the file isn't binary, you are on your way.&lt;/P&gt;

&lt;P&gt;That said, there are 6 key things that you must configure correctly:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;host (where the data came from)&lt;/LI&gt;
&lt;LI&gt;source (the name of the file or other type of input)&lt;/LI&gt;
&lt;LI&gt;sourcetype&lt;/LI&gt;
&lt;LI&gt;timestamp&lt;/LI&gt;
&lt;LI&gt;index (where to store the event. By default, it goes into the main index.)&lt;/LI&gt;
&lt;LI&gt;line-breaking (how to break the input stream into events)&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Most of these are easy, and Splunk usually figures them it all by itself. Source = name of file for your input. Simple. Line-breaking and timestamp extraction are usually defined as part of the sourcetype. If you have a common sourcetype (see the list of &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.1/Data/Listofpretrainedsourcetypes"&gt;pretrained sourcetypes&lt;/A&gt;), Splunk can even figure out the sourcetype for you.&lt;/P&gt;

&lt;P&gt;For an XML file though, usually Splunk will need your help. One way to do this is with the Data Preview feature, which is described &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.1/Data/Overviewofdatapreview"&gt;here&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Usually, you will need to define a sourcetype for your input, unless one of the &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.1/Data/Listofpretrainedsourcetypes"&gt;pretrained sourcetypes&lt;/A&gt; works for you.  Just think up a name and assign in to the input - maybe &lt;CODE&gt;xunit&lt;/CODE&gt;. More info &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.1/Data/Createsourcetypes"&gt;here&lt;/A&gt;, with links to details on setting the line-breaking and timestamp characteristics for your sourcetype.&lt;/P&gt;

&lt;P&gt;Finally, here are a few other questions about XML files on the forum:&lt;BR /&gt;&lt;BR /&gt;
&lt;A href="http://splunk-base.splunk.com/answers/2141/xml-log-source-type"&gt;http://splunk-base.splunk.com/answers/2141/xml-log-source-type&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;A href="http://splunk-base.splunk.com/answers/683/xml-input-line-breaking-and-field-extraction-how"&gt;http://splunk-base.splunk.com/answers/683/xml-input-line-breaking-and-field-extraction-how&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Dec 2012 02:48:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-xunit-files/m-p/57042#M3031</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-12-09T02:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to use xunit files?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-xunit-files/m-p/57043#M3032</link>
      <description>&lt;P&gt;Thanks! We ended up defining an xunit source type which is working nicely- thanks!&lt;/P&gt;

&lt;P&gt;Yaron&lt;/P&gt;</description>
      <pubDate>Sat, 22 Dec 2012 06:18:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-xunit-files/m-p/57043#M3032</guid>
      <dc:creator>kretch</dc:creator>
      <dc:date>2012-12-22T06:18:38Z</dc:date>
    </item>
  </channel>
</rss>

