<?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: XML input line-breaking and field extraction - how? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/XML-input-line-breaking-and-field-extraction-how/m-p/10191#M396</link>
    <description>&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_PREFIX = \&amp;lt;CreationDate\&amp;gt;
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%3N
SHOULD_LINEMERGE = false
LINE_BREAKER = \&amp;gt;\s*(?=\&amp;lt;row\&amp;gt;)
REPORT-xmlext = xml-extr
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[xml-extr]
REGEX = \&amp;lt;(\w+)\&amp;gt;([^\&amp;gt;]*)\&amp;lt;\1\&amp;gt;
FORMAT = $1::$2
MV_ADD = true
REPEAT_MATCH = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;should do it.&lt;/P&gt;</description>
    <pubDate>Sun, 14 Mar 2010 14:56:46 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2010-03-14T14:56:46Z</dc:date>
    <item>
      <title>XML input line-breaking and field extraction - how?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/XML-input-line-breaking-and-field-extraction-how/m-p/10190#M395</link>
      <description>&lt;P&gt;I am trying to index an XML file which looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt; 
 &amp;lt;Posts2Votes&amp;gt;
  &amp;lt;row&amp;gt;
   &amp;lt;Id&amp;gt;1&amp;lt;/Id&amp;gt; 
   &amp;lt;PostId&amp;gt;7&amp;lt;/PostId&amp;gt; 
   &amp;lt;UserId&amp;gt;2&amp;lt;/UserId&amp;gt; 
   &amp;lt;VoteTypeId&amp;gt;2&amp;lt;/VoteTypeId&amp;gt; 
   &amp;lt;CreationDate&amp;gt;2009-11-06T02:22:37.063&amp;lt;/CreationDate&amp;gt; 
   &amp;lt;TargetUserId&amp;gt;7&amp;lt;/TargetUserId&amp;gt; 
   &amp;lt;TargetRepChange&amp;gt;10&amp;lt;/TargetRepChange&amp;gt; 
   &amp;lt;IPAddress&amp;gt;64.127.105.60&amp;lt;/IPAddress&amp;gt; 
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
   &amp;lt;Id&amp;gt;2&amp;lt;/Id&amp;gt; 
   &amp;lt;PostId&amp;gt;6&amp;lt;/PostId&amp;gt; 
   &amp;lt;UserId&amp;gt;2&amp;lt;/UserId&amp;gt; 
   &amp;lt;VoteTypeId&amp;gt;2&amp;lt;/VoteTypeId&amp;gt; 
   &amp;lt;CreationDate&amp;gt;2009-11-06T02:22:38.25&amp;lt;/CreationDate&amp;gt; 
   &amp;lt;TargetUserId&amp;gt;31&amp;lt;/TargetUserId&amp;gt; 
   &amp;lt;TargetRepChange&amp;gt;10&amp;lt;/TargetRepChange&amp;gt; 
   &amp;lt;IPAddress&amp;gt;64.127.105.60&amp;lt;/IPAddress&amp;gt; 
  &amp;lt;/row&amp;gt;
  &amp;lt;!-- more "row" elements go here --&amp;gt;
 &amp;lt;/Posts2Votes&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Splunk's default parser will recognizes the timestamps correctly but does not split the events on each &lt;CODE&gt;&amp;lt;row&amp;gt;&lt;/CODE&gt; element, and no fields are extracted by default.  OK, now I need to figure out how to extract these fields and break the lines correctly. Any ideas?&lt;/P&gt;</description>
      <pubDate>Sun, 14 Mar 2010 06:45:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/XML-input-line-breaking-and-field-extraction-how/m-p/10190#M395</guid>
      <dc:creator>Justin_Grant</dc:creator>
      <dc:date>2010-03-14T06:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: XML input line-breaking and field extraction - how?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/XML-input-line-breaking-and-field-extraction-how/m-p/10191#M396</link>
      <description>&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_PREFIX = \&amp;lt;CreationDate\&amp;gt;
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%3N
SHOULD_LINEMERGE = false
LINE_BREAKER = \&amp;gt;\s*(?=\&amp;lt;row\&amp;gt;)
REPORT-xmlext = xml-extr
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[xml-extr]
REGEX = \&amp;lt;(\w+)\&amp;gt;([^\&amp;gt;]*)\&amp;lt;\1\&amp;gt;
FORMAT = $1::$2
MV_ADD = true
REPEAT_MATCH = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;should do it.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Mar 2010 14:56:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/XML-input-line-breaking-and-field-extraction-how/m-p/10191#M396</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-03-14T14:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: XML input line-breaking and field extraction - how?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/XML-input-line-breaking-and-field-extraction-how/m-p/10192#M397</link>
      <description>&lt;P&gt;Where you able to get this work?  I tried it but it does not break the events from one another cleanly.&lt;/P&gt;

&lt;P&gt;I do have a subdata within the top group, so after the row group, I have a subrow that contains data for the row group, so that might be what's skewing me.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2010 19:31:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/XML-input-line-breaking-and-field-extraction-how/m-p/10192#M397</guid>
      <dc:creator>BunnyHop</dc:creator>
      <dc:date>2010-03-16T19:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: XML input line-breaking and field extraction - how?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/XML-input-line-breaking-and-field-extraction-how/m-p/10193#M398</link>
      <description>&lt;P&gt;There is a small error in above regex, correct one is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = \&amp;lt;(\w+)\&amp;gt;([^\&amp;lt;]*)\&amp;lt;/\1\&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Oct 2010 16:18:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/XML-input-line-breaking-and-field-extraction-how/m-p/10193#M398</guid>
      <dc:creator>gljiva</dc:creator>
      <dc:date>2010-10-18T16:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: XML input line-breaking and field extraction - how?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/XML-input-line-breaking-and-field-extraction-how/m-p/10194#M399</link>
      <description>&lt;P&gt;This is tested working:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = &amp;lt;([^&amp;gt;]+)&amp;gt;([^&amp;lt;]*)&amp;lt;\/\1&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Dec 2011 21:54:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/XML-input-line-breaking-and-field-extraction-how/m-p/10194#M399</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2011-12-06T21:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: XML input line-breaking and field extraction - how?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/XML-input-line-breaking-and-field-extraction-how/m-p/10195#M400</link>
      <description>&lt;P&gt;Thanks. This is a very helpful post. The documentation really should be a lot more newbie-friendly. Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 28 Sep 2013 05:18:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/XML-input-line-breaking-and-field-extraction-how/m-p/10195#M400</guid>
      <dc:creator>charlie_park2</dc:creator>
      <dc:date>2013-09-28T05:18:12Z</dc:date>
    </item>
  </channel>
</rss>

