<?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 Consolidate fields at search time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12457#M1021</link>
    <description>&lt;P&gt;How can I consolidate 2 or more fields into one new field at search time?&lt;/P&gt;

&lt;P&gt;e.g. ...| fields a,b,c | d&lt;/P&gt;

&lt;P&gt;In the above I would like d to hold all values in fields a,b,c so what I am doing is creating a new field called d out of the fields a,b and c. Is this possible?&lt;/P&gt;</description>
    <pubDate>Wed, 28 Apr 2010 23:58:02 GMT</pubDate>
    <dc:creator>Josh</dc:creator>
    <dc:date>2010-04-28T23:58:02Z</dc:date>
    <item>
      <title>Consolidate fields at search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12457#M1021</link>
      <description>&lt;P&gt;How can I consolidate 2 or more fields into one new field at search time?&lt;/P&gt;

&lt;P&gt;e.g. ...| fields a,b,c | d&lt;/P&gt;

&lt;P&gt;In the above I would like d to hold all values in fields a,b,c so what I am doing is creating a new field called d out of the fields a,b and c. Is this possible?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2010 23:58:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12457#M1021</guid>
      <dc:creator>Josh</dc:creator>
      <dc:date>2010-04-28T23:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Consolidate fields at search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12458#M1022</link>
      <description>&lt;P&gt;If you want them all concatenated, then you can do:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;&lt;CODE&gt;eval d=a.b.c&lt;/CODE&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;If you want a multi-value field, you could do something like this (assuming that you don't have &lt;CODE&gt;;&lt;/CODE&gt; in your values to begin with):&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;&lt;CODE&gt;eval d=split(a . ";" . b . ";" . c, ";")&lt;/CODE&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;If you are trying to get a single value when a, b, or c could be null (or missing), then you can use:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;&lt;CODE&gt;eval d=coalesce(a,b,c)&lt;/CODE&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Are any of these what you are looking for?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2010 00:14:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12458#M1022</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-04-29T00:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Consolidate fields at search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12459#M1023</link>
      <description>&lt;P&gt;Eval command could do this:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Eval" rel="nofollow"&gt;http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Eval&lt;/A&gt;&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;... | eval
  field_d=field_a+field_b+field_c |
  fields field_d&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Also, the nomv command might be helpful for your use case:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Nomv" rel="nofollow"&gt;http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Nomv&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2010 00:18:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12459#M1023</guid>
      <dc:creator>Simeon</dc:creator>
      <dc:date>2010-04-29T00:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Consolidate fields at search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12460#M1024</link>
      <description>&lt;P&gt;eval d=coalesce(a,b,c)&lt;/P&gt;

&lt;P&gt;This worked a treat, single value when a,b or c wcould be null (or missing)&lt;/P&gt;

&lt;P&gt;Perfect thanks&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2010 00:45:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12460#M1024</guid>
      <dc:creator>Josh</dc:creator>
      <dc:date>2010-04-29T00:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Consolidate fields at search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12461#M1025</link>
      <description>&lt;P&gt;Also, if you want to create a single multi-valued field, you would concatenate the values with a delimiter as in one of the other answers, and then use the &lt;CODE&gt;| makemv&lt;/CODE&gt; command.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2010 00:50:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12461#M1025</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-04-29T00:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Consolidate fields at search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12462#M1026</link>
      <description>&lt;P&gt;Is there an advantage to using &lt;CODE&gt;makemv&lt;/CODE&gt; vs using &lt;CODE&gt;split()&lt;/CODE&gt; eval function?  (Other than &lt;CODE&gt;split()&lt;/CODE&gt; was introduced in 4.1)&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2010 01:31:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12462#M1026</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-04-29T01:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Consolidate fields at search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12463#M1027</link>
      <description>&lt;P&gt;No, it's the same.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2010 02:57:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12463#M1027</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-04-29T02:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Consolidate fields at search time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12464#M1028</link>
      <description>&lt;P&gt;If your intention ultimately is to get statistics or data about each unique combination of a, b and c,  then its easier to do things like "stats avg(foo) values(bar) by a, b, c".&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2010 02:58:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Consolidate-fields-at-search-time/m-p/12464#M1028</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2010-04-29T02:58:48Z</dc:date>
    </item>
  </channel>
</rss>

