<?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 Field Extraction to Modify Key in Key Value Pair at Search Time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-to-Modify-Key-in-Key-Value-Pair-at-Search-Time/m-p/159836#M45135</link>
    <description>&lt;P&gt;How can I create a field extraction to modify a key in a key value pair? I have a new file that I am indexing. The key is using "source" and this is conflicting with the built in "source" in Splunk. Making this change when the file is getting indexed will not work in this situation. I am looking to do this at Search Time.&lt;/P&gt;

&lt;P&gt;2014-07-23 09:59:56,996 || Thread=9 || channel=CONTACTVIEW || endTimeRaw=1406123991420 || duration=3786 || startTimeRaw=1406123987634 || source=Portfolio || endTime=2014-07-23T13:59:51.420Z &lt;/P&gt;</description>
    <pubDate>Mon, 28 Jul 2014 18:21:44 GMT</pubDate>
    <dc:creator>ezajac</dc:creator>
    <dc:date>2014-07-28T18:21:44Z</dc:date>
    <item>
      <title>Field Extraction to Modify Key in Key Value Pair at Search Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-to-Modify-Key-in-Key-Value-Pair-at-Search-Time/m-p/159836#M45135</link>
      <description>&lt;P&gt;How can I create a field extraction to modify a key in a key value pair? I have a new file that I am indexing. The key is using "source" and this is conflicting with the built in "source" in Splunk. Making this change when the file is getting indexed will not work in this situation. I am looking to do this at Search Time.&lt;/P&gt;

&lt;P&gt;2014-07-23 09:59:56,996 || Thread=9 || channel=CONTACTVIEW || endTimeRaw=1406123991420 || duration=3786 || startTimeRaw=1406123987634 || source=Portfolio || endTime=2014-07-23T13:59:51.420Z &lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2014 18:21:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-to-Modify-Key-in-Key-Value-Pair-at-Search-Time/m-p/159836#M45135</guid>
      <dc:creator>ezajac</dc:creator>
      <dc:date>2014-07-28T18:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction to Modify Key in Key Value Pair at Search Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-to-Modify-Key-in-Key-Value-Pair-at-Search-Time/m-p/159837#M45136</link>
      <description>&lt;P&gt;One way i can think of is replacing the word source in your logs. Check this&lt;/P&gt;

&lt;P&gt;&lt;A href="http://"&gt;http://answers.splunk.com/answers/71277/character-set-replacement-during-indexing&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2014 18:47:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-to-Modify-Key-in-Key-Value-Pair-at-Search-Time/m-p/159837#M45136</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2014-07-28T18:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction to Modify Key in Key Value Pair at Search Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-to-Modify-Key-in-Key-Value-Pair-at-Search-Time/m-p/159838#M45137</link>
      <description>&lt;P&gt;Can anything be done at Search Time like a field extraction?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2014 19:38:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-to-Modify-Key-in-Key-Value-Pair-at-Search-Time/m-p/159838#M45137</guid>
      <dc:creator>ezajac</dc:creator>
      <dc:date>2014-07-28T19:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction to Modify Key in Key Value Pair at Search Time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-to-Modify-Key-in-Key-Value-Pair-at-Search-Time/m-p/159839#M45138</link>
      <description>&lt;P&gt;you can extract value "Portfolio" with different field name using rex command or in the props.conf directly.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.2/Knowledge/Addfieldsatsearchtime"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.2/Knowledge/Addfieldsatsearchtime&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Using rex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex " source=(?&amp;lt;orig_source&amp;gt;w+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can put the same regex in props.conf.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[YourSourcetype]
...other settings...
EXTRACT-orig_group = (?i) source=(?&amp;lt;orig_source&amp;gt;w+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Jul 2014 19:42:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-to-Modify-Key-in-Key-Value-Pair-at-Search-Time/m-p/159839#M45138</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-28T19:42:03Z</dc:date>
    </item>
  </channel>
</rss>

