<?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 combine two field results into single field permanently ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-field-results-into-single-field-permanently/m-p/450883#M127683</link>
    <description>&lt;OL&gt;
&lt;LI&gt;please post a sample of the data&lt;/LI&gt;
&lt;LI&gt;are the fields rs_time1 and rs_time2 always present in all events, mutually exclusive, or sometimes both, sometimes one of them, and sometimes neither?&lt;/LI&gt;
&lt;LI&gt;are you performing the extraction or are they naturally identified fields by Splunk?&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;&lt;STRONG&gt;assuming Splunk is identifying the fields and that you have not manually extracted them:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;in  &lt;CODE&gt;props.conf&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sourcetype]
EVAL-rs_time = if(isnotnull('rs_time1'),'rs_time1','rs_time2')
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Sep 2020 21:10:06 GMT</pubDate>
    <dc:creator>marycordova</dc:creator>
    <dc:date>2020-09-29T21:10:06Z</dc:date>
    <item>
      <title>How to combine two field results into single field permanently ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-field-results-into-single-field-permanently/m-p/450879#M127679</link>
      <description>&lt;P&gt;Lets say I have extracted two fields rs_time1 and rs_time2. But now, I want to merge the values from these fields to one single field called rs_time . I have the following query, which does correctly what I wanted in search time , but is there a way to do it permanently rather than during search time ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval "rs_time"=coalesce(rs_time1,rs_time2)
|stats avg(rs_time) as res_time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:12:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-field-results-into-single-field-permanently/m-p/450879#M127679</guid>
      <dc:creator>navd</dc:creator>
      <dc:date>2020-09-29T21:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two field results into single field permanently ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-field-results-into-single-field-permanently/m-p/450880#M127680</link>
      <description>&lt;P&gt;Hey @navd, &lt;/P&gt;

&lt;P&gt;sure it's possible and you already have the right strategy with the &lt;CODE&gt;coalesce&lt;/CODE&gt; command. &lt;/P&gt;

&lt;P&gt;I posted you a link about &lt;STRONG&gt;Calculated Fields&lt;/STRONG&gt; that will help you further. &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.2/Knowledge/definecalcfields"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.2/Knowledge/definecalcfields&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Tell us if you need further assistance. &lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 19:38:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-field-results-into-single-field-permanently/m-p/450880#M127680</guid>
      <dc:creator>horsefez</dc:creator>
      <dc:date>2018-09-06T19:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two field results into single field permanently ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-field-results-into-single-field-permanently/m-p/450881#M127681</link>
      <description>&lt;P&gt;@navd, &lt;/P&gt;

&lt;P&gt;did this help you?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 16:31:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-field-results-into-single-field-permanently/m-p/450881#M127681</guid>
      <dc:creator>horsefez</dc:creator>
      <dc:date>2018-09-07T16:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two field results into single field permanently ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-field-results-into-single-field-permanently/m-p/450882#M127682</link>
      <description>&lt;P&gt;If the data comes from a heavy forwarder, you can use transforms.conf to create the merged field before the data is ingested to your indexers&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 17:03:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-field-results-into-single-field-permanently/m-p/450882#M127682</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2018-09-07T17:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two field results into single field permanently ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-field-results-into-single-field-permanently/m-p/450883#M127683</link>
      <description>&lt;OL&gt;
&lt;LI&gt;please post a sample of the data&lt;/LI&gt;
&lt;LI&gt;are the fields rs_time1 and rs_time2 always present in all events, mutually exclusive, or sometimes both, sometimes one of them, and sometimes neither?&lt;/LI&gt;
&lt;LI&gt;are you performing the extraction or are they naturally identified fields by Splunk?&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;&lt;STRONG&gt;assuming Splunk is identifying the fields and that you have not manually extracted them:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;in  &lt;CODE&gt;props.conf&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sourcetype]
EVAL-rs_time = if(isnotnull('rs_time1'),'rs_time1','rs_time2')
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:10:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-field-results-into-single-field-permanently/m-p/450883#M127683</guid>
      <dc:creator>marycordova</dc:creator>
      <dc:date>2020-09-29T21:10:06Z</dc:date>
    </item>
  </channel>
</rss>

