<?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 do I rename xml fields in props.conf? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-rename-xml-fields-in-props-conf/m-p/174180#M35060</link>
    <description>&lt;P&gt;I have a file of XML-like events that look like this:&lt;/P&gt;

&lt;PRE&gt;
&amp;lt;Event Field1=foo Field2=bar Field3=baz &amp;gt;
    &amp;lt;Data Field4=whz Field5=zip Field3=floo/&amp;gt;
&amp;lt;/Event&amp;gt;
&lt;/PRE&gt;

&lt;P&gt;Both the Event line and the Data line have a field named Field3, and they are automatically extracted as the same field in the search.  Is there a way to prepend the first tag (i.e. either Event or Data) to the Field3 name so Splunk can tell they're distinct?  Prepending Event or Data to all the field names would also work.&lt;/P&gt;

&lt;P&gt;In props.conf:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
[xml_sample]&lt;BR /&gt;
SHOULD_LINEMERGE = true&lt;BR /&gt;
DATETIME_CONFIG = NONE&lt;BR /&gt;
BREAK_ONLY_BEFORE_DATE = false&lt;BR /&gt;
BREAK_ONLY_BEFORE =]&amp;gt;&lt;BR /&gt;
MUST_BREAK_AFTER = &lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 18:34:37 GMT</pubDate>
    <dc:creator>cphair</dc:creator>
    <dc:date>2020-09-28T18:34:37Z</dc:date>
    <item>
      <title>How do I rename xml fields in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-rename-xml-fields-in-props-conf/m-p/174180#M35060</link>
      <description>&lt;P&gt;I have a file of XML-like events that look like this:&lt;/P&gt;

&lt;PRE&gt;
&amp;lt;Event Field1=foo Field2=bar Field3=baz &amp;gt;
    &amp;lt;Data Field4=whz Field5=zip Field3=floo/&amp;gt;
&amp;lt;/Event&amp;gt;
&lt;/PRE&gt;

&lt;P&gt;Both the Event line and the Data line have a field named Field3, and they are automatically extracted as the same field in the search.  Is there a way to prepend the first tag (i.e. either Event or Data) to the Field3 name so Splunk can tell they're distinct?  Prepending Event or Data to all the field names would also work.&lt;/P&gt;

&lt;P&gt;In props.conf:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
[xml_sample]&lt;BR /&gt;
SHOULD_LINEMERGE = true&lt;BR /&gt;
DATETIME_CONFIG = NONE&lt;BR /&gt;
BREAK_ONLY_BEFORE_DATE = false&lt;BR /&gt;
BREAK_ONLY_BEFORE =]&amp;gt;&lt;BR /&gt;
MUST_BREAK_AFTER = &lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:34:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-rename-xml-fields-in-props-conf/m-p/174180#M35060</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2020-09-28T18:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rename xml fields in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-rename-xml-fields-in-props-conf/m-p/174181#M35061</link>
      <description>&lt;P&gt;I would disable the automatic key-value extractions with &lt;STRONG&gt;KV_MODE = none&lt;/STRONG&gt; and then define your own regex based extractions which use the element names, "Event" and "Data" for example as anchors.  If you don't know how to set up regex extractions in the config files, the interactive field extractor tool might help you at least get close to the regex you need if not the exact regex you need, depending on your data and how it responds to you removing the values it gets wrong, presuming it selects incorrect fields from other XML elements.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jan 2015 19:00:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-rename-xml-fields-in-props-conf/m-p/174181#M35061</guid>
      <dc:creator>chanfoli</dc:creator>
      <dc:date>2015-01-06T19:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rename xml fields in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-rename-xml-fields-in-props-conf/m-p/174182#M35062</link>
      <description>&lt;P&gt;I was hoping there was an easier way, but I guess this'll work.  Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2015 13:14:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-rename-xml-fields-in-props-conf/m-p/174182#M35062</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2015-01-07T13:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rename xml fields in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-rename-xml-fields-in-props-conf/m-p/174183#M35063</link>
      <description>&lt;P&gt;If its during search time, you can either use the mode=sed with a regular expression&lt;/P&gt;

&lt;P&gt;For e.g.&lt;/P&gt;

&lt;P&gt;| rex mode=sed "s///g"&lt;/P&gt;

&lt;P&gt;OR I would use sedcmd in props.conf&lt;/P&gt;

&lt;P&gt;SEDCMD-change_field = s///g&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2015 13:34:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-rename-xml-fields-in-props-conf/m-p/174183#M35063</guid>
      <dc:creator>gabetheISguy</dc:creator>
      <dc:date>2015-01-07T13:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rename xml fields in props.conf?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-rename-xml-fields-in-props-conf/m-p/174184#M35064</link>
      <description>&lt;P&gt;Regexing from the search interface isn't convenient when you have to do it for every search.  SEDCMD replaces the raw data, and I just want to update the field names.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2015 14:04:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-rename-xml-fields-in-props-conf/m-p/174184#M35064</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2015-01-07T14:04:35Z</dc:date>
    </item>
  </channel>
</rss>

