<?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: concatenating more than one field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/concatenating-more-than-one-field/m-p/89490#M182226</link>
    <description>&lt;P&gt;use an eval to concatenate the fields, and in the case a field is missing, use a sed command to remove the extra separation commas.&lt;/P&gt;

&lt;PRE&gt;
mysearch | fillnull value="" field1 field2 field3 | eval myfield=field1.",".field2.",".field3 | rex field=myfield mode=sed "s/([,]*)}/,/g" | table myfield
&lt;/PRE&gt;

&lt;P&gt;remark : sed command not tested, please try or replace by some logic in the eval.&lt;/P&gt;</description>
    <pubDate>Mon, 15 Oct 2012 04:47:10 GMT</pubDate>
    <dc:creator>yannK</dc:creator>
    <dc:date>2012-10-15T04:47:10Z</dc:date>
    <item>
      <title>concatenating more than one field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/concatenating-more-than-one-field/m-p/89489#M182225</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have three fields : &lt;/P&gt;

&lt;P&gt;field1       field2     field3&lt;BR /&gt;
delhi&lt;BR /&gt;
delhi&lt;BR /&gt;
                         kol&lt;BR /&gt;
delhi        mumbai&lt;BR /&gt;&lt;BR /&gt;
delhi                    kol&lt;BR /&gt;&lt;BR /&gt;
mumbai       kolkata     andhra  &lt;/P&gt;

&lt;P&gt;Output should be like : &lt;/P&gt;

&lt;P&gt;Final_Field&lt;BR /&gt;
delhi&lt;BR /&gt;
delhi&lt;BR /&gt;
kol&lt;BR /&gt;
delhi,mumbai&lt;BR /&gt;
delhi,kol&lt;BR /&gt;
mumbai,kolkata,andhra&lt;/P&gt;

&lt;P&gt;Please help !!&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 14 Oct 2012 19:28:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/concatenating-more-than-one-field/m-p/89489#M182225</guid>
      <dc:creator>abhayneilam</dc:creator>
      <dc:date>2012-10-14T19:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating more than one field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/concatenating-more-than-one-field/m-p/89490#M182226</link>
      <description>&lt;P&gt;use an eval to concatenate the fields, and in the case a field is missing, use a sed command to remove the extra separation commas.&lt;/P&gt;

&lt;PRE&gt;
mysearch | fillnull value="" field1 field2 field3 | eval myfield=field1.",".field2.",".field3 | rex field=myfield mode=sed "s/([,]*)}/,/g" | table myfield
&lt;/PRE&gt;

&lt;P&gt;remark : sed command not tested, please try or replace by some logic in the eval.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2012 04:47:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/concatenating-more-than-one-field/m-p/89490#M182226</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2012-10-15T04:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating more than one field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/concatenating-more-than-one-field/m-p/89491#M182227</link>
      <description>&lt;P&gt;Thats what one would like to think, but if either of the fields is missing altogether, the eval fails.&lt;/P&gt;

&lt;P&gt;You'd have to use &lt;CODE&gt;fillnull&lt;/CODE&gt; or similar first.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2012 10:40:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/concatenating-more-than-one-field/m-p/89491#M182227</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-10-15T10:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: concatenating more than one field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/concatenating-more-than-one-field/m-p/89492#M182228</link>
      <description>&lt;P&gt;Thanks Kristian, the fillnull is required indeed, let me add it.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2012 14:13:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/concatenating-more-than-one-field/m-p/89492#M182228</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2012-10-15T14:13:08Z</dc:date>
    </item>
  </channel>
</rss>

