<?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 xml field extraction in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/xml-field-extraction/m-p/401475#M26286</link>
    <description>&lt;P&gt;I have one xml file &lt;BR /&gt;
I want to extract the fields/values IN BETWEEN and and throw away any of the lines before the very first and after the very last . &lt;BR /&gt;
(In XML, the fields/values are located on each line in the form value)&lt;BR /&gt;
4. Use the date in the ActionDate field and the time in the ActionTime field as the timestamp.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;Interceptor&amp;gt;
             &amp;lt;AttackCoords&amp;gt;-423423445345345.10742916222947&amp;lt;/AttackCoords&amp;gt;
             &amp;lt;Outcome&amp;gt;Inteccccn&amp;lt;/Outcome&amp;gt;
             &amp;lt;Infiltrators&amp;gt;20&amp;lt;/Infiltrators&amp;gt;
             &amp;lt;Enforcer&amp;gt;Iwildwood&amp;lt;/Enforcer&amp;gt;
             &amp;lt;ActionDate&amp;gt;2013-04-24&amp;lt;/ActionDate&amp;gt;
             &amp;lt;ActionTime&amp;gt;00:07:00&amp;lt;/ActionTime&amp;gt;
             &amp;lt;RecordNotes&amp;gt;&amp;lt;/RecordNotes&amp;gt;
             &amp;lt;NumEscaped&amp;gt;0&amp;lt;/NumEscaped&amp;gt;
             &amp;lt;LaunchCoords&amp;gt;-80.23429525620114,24.08680387475695&amp;lt;/LaunchCoords&amp;gt;
             &amp;lt;AttackVessel&amp;gt;local&amp;lt;/AttackVessel&amp;gt;
         &amp;lt;/Interceptor&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;below is my props.conf and transforms.conf&lt;BR /&gt;
props.conf&lt;BR /&gt;
[dreamcrusher]&lt;BR /&gt;
BREAK_ONLY_BEFORE = &lt;BR /&gt;
DATETIME_CONFIG = &lt;BR /&gt;
NO_BINARY_CHECK = true&lt;BR /&gt;
TIME_FORMAT = &lt;BR /&gt;
TIME_PREFIX = &lt;BR /&gt;
category = Custom&lt;BR /&gt;
disabled = false&lt;BR /&gt;
pulldown_type = true&lt;BR /&gt;
PREAMBLE_REGEX = ^&amp;lt;\S+.*&lt;BR /&gt;
REPORT-dream = dream&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;BR /&gt;
[dream]&lt;BR /&gt;
REGEX = ^&amp;lt;(.*?)&amp;gt;(\S+)&amp;lt;&lt;/P&gt;

&lt;H1&gt;FORMAT = $1::$2&lt;/H1&gt;

&lt;P&gt;when i check the events there are no search time extraction&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 20:51:28 GMT</pubDate>
    <dc:creator>riqbal</dc:creator>
    <dc:date>2020-09-29T20:51:28Z</dc:date>
    <item>
      <title>xml field extraction</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/xml-field-extraction/m-p/401475#M26286</link>
      <description>&lt;P&gt;I have one xml file &lt;BR /&gt;
I want to extract the fields/values IN BETWEEN and and throw away any of the lines before the very first and after the very last . &lt;BR /&gt;
(In XML, the fields/values are located on each line in the form value)&lt;BR /&gt;
4. Use the date in the ActionDate field and the time in the ActionTime field as the timestamp.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;Interceptor&amp;gt;
             &amp;lt;AttackCoords&amp;gt;-423423445345345.10742916222947&amp;lt;/AttackCoords&amp;gt;
             &amp;lt;Outcome&amp;gt;Inteccccn&amp;lt;/Outcome&amp;gt;
             &amp;lt;Infiltrators&amp;gt;20&amp;lt;/Infiltrators&amp;gt;
             &amp;lt;Enforcer&amp;gt;Iwildwood&amp;lt;/Enforcer&amp;gt;
             &amp;lt;ActionDate&amp;gt;2013-04-24&amp;lt;/ActionDate&amp;gt;
             &amp;lt;ActionTime&amp;gt;00:07:00&amp;lt;/ActionTime&amp;gt;
             &amp;lt;RecordNotes&amp;gt;&amp;lt;/RecordNotes&amp;gt;
             &amp;lt;NumEscaped&amp;gt;0&amp;lt;/NumEscaped&amp;gt;
             &amp;lt;LaunchCoords&amp;gt;-80.23429525620114,24.08680387475695&amp;lt;/LaunchCoords&amp;gt;
             &amp;lt;AttackVessel&amp;gt;local&amp;lt;/AttackVessel&amp;gt;
         &amp;lt;/Interceptor&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;below is my props.conf and transforms.conf&lt;BR /&gt;
props.conf&lt;BR /&gt;
[dreamcrusher]&lt;BR /&gt;
BREAK_ONLY_BEFORE = &lt;BR /&gt;
DATETIME_CONFIG = &lt;BR /&gt;
NO_BINARY_CHECK = true&lt;BR /&gt;
TIME_FORMAT = &lt;BR /&gt;
TIME_PREFIX = &lt;BR /&gt;
category = Custom&lt;BR /&gt;
disabled = false&lt;BR /&gt;
pulldown_type = true&lt;BR /&gt;
PREAMBLE_REGEX = ^&amp;lt;\S+.*&lt;BR /&gt;
REPORT-dream = dream&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;BR /&gt;
[dream]&lt;BR /&gt;
REGEX = ^&amp;lt;(.*?)&amp;gt;(\S+)&amp;lt;&lt;/P&gt;

&lt;H1&gt;FORMAT = $1::$2&lt;/H1&gt;

&lt;P&gt;when i check the events there are no search time extraction&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:51:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/xml-field-extraction/m-p/401475#M26286</guid>
      <dc:creator>riqbal</dc:creator>
      <dc:date>2020-09-29T20:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: xml field extraction</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/xml-field-extraction/m-p/401476#M26287</link>
      <description>&lt;P&gt;You didn’t say in between what...&lt;/P&gt;

&lt;P&gt;Have you tried the xmlkv command?  How about xpath or spath?  See these links on how to use those:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.2/SearchReference/Xmlkv" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.2/SearchReference/Xmlkv&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.2/SearchReference/Xpath" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.2/SearchReference/Xpath&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.2/SearchReference/Spath" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.2/SearchReference/Spath&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;props.conf on the universal forwarder&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [sourcetypeName]
 INDEXED_EXTRACTIONS=xml
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or if you want to extract the fields automatically at search time use KV_MODE instead of INDEXED_EXTRACTIONS.  INDEXED_EXTRACTIONS actually index the fields which takes more disk space but it makes all the fields available to tstats searches.  On a small data source it can be great, on a large data source it can cause more problems than its worth. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; KV_MODE=xml
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also note that INDEXED_EXTRACTIONS occur on the first splunk that sees the data (typically a forwarder, maybe your laptop in this case)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:52:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/xml-field-extraction/m-p/401476#M26287</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2020-09-29T20:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: xml field extraction</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/xml-field-extraction/m-p/401477#M26288</link>
      <description>&lt;P&gt;Referring post : "How to extract XML field data using transforms.conf?" &lt;BR /&gt;
mentioned regex works with me. &lt;/P&gt;

&lt;P&gt;REGEX = &amp;lt;(\w+)&amp;gt;([^&amp;lt;]+)&lt;BR /&gt;
FORMAT = $1::$2&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 08:27:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/xml-field-extraction/m-p/401477#M26288</guid>
      <dc:creator>riqbal</dc:creator>
      <dc:date>2018-08-16T08:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: xml field extraction</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/xml-field-extraction/m-p/401478#M26289</link>
      <description>&lt;P&gt;When using KV_MODE=xml, do we still use the LIne_Breaker and Should_Linemerge settings?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:53:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/xml-field-extraction/m-p/401478#M26289</guid>
      <dc:creator>gkwl22000</dc:creator>
      <dc:date>2020-09-29T20:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: xml field extraction</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/xml-field-extraction/m-p/401479#M26290</link>
      <description>&lt;P&gt;i guess they arent needed unless you have the xml nested within another data type like json with nested xml or something.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 17:18:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/xml-field-extraction/m-p/401479#M26290</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2018-08-16T17:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: xml field extraction</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/xml-field-extraction/m-p/401480#M26291</link>
      <description>&lt;P&gt;yes it is nest xml&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 17:21:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/xml-field-extraction/m-p/401480#M26291</guid>
      <dc:creator>gkwl22000</dc:creator>
      <dc:date>2018-08-16T17:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: xml field extraction</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/xml-field-extraction/m-p/401481#M26292</link>
      <description>&lt;P&gt;thanks for sharing important information. in fact, it is my 2nd step to complete the lab.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Aug 2018 06:32:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/xml-field-extraction/m-p/401481#M26292</guid>
      <dc:creator>riqbal</dc:creator>
      <dc:date>2018-08-26T06:32:23Z</dc:date>
    </item>
  </channel>
</rss>

