<?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: Combining fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Combining-fields/m-p/465039#M131032</link>
    <description>&lt;P&gt;Unfortunately, it does not work.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Feb 2020 10:29:02 GMT</pubDate>
    <dc:creator>gagareg</dc:creator>
    <dc:date>2020-02-13T10:29:02Z</dc:date>
    <item>
      <title>Combining fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-fields/m-p/465037#M131030</link>
      <description>&lt;P&gt;How to combine three fields in one field and display it as table? I need one field called emails consisting of from, to and user fields&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8349i7EDB83490E0E52C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8350iEE6781ACCF66A128/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 13:20:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-fields/m-p/465037#M131030</guid>
      <dc:creator>gagareg</dc:creator>
      <dc:date>2020-02-11T13:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Combining fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-fields/m-p/465038#M131031</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;

&lt;P&gt;Try below query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your base search&amp;gt; | eval new_field = field_1 . "--" . field_2 . "--" . field_3
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Feb 2020 13:36:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-fields/m-p/465038#M131031</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2020-02-11T13:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Combining fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-fields/m-p/465039#M131032</link>
      <description>&lt;P&gt;Unfortunately, it does not work.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 10:29:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-fields/m-p/465039#M131032</guid>
      <dc:creator>gagareg</dc:creator>
      <dc:date>2020-02-13T10:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: Combining fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-fields/m-p/465040#M131033</link>
      <description>&lt;P&gt;Hi @gagareg,&lt;BR /&gt;
in each event do you have only one value (to or from or user) or could you have in the same event more fields?&lt;/P&gt;

&lt;P&gt;If you have only one field for event, you can use coalesce function:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval email=coalesce(to,from,user)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If instewad you surely have all the three fields in each event, you can use a solution like the one of @harsmarvania57 &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval email=to."--".from."--".user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if you could have more fields in the same event but you're not sure that there are always all the three fields, you have to add a value to the three fields when there's no value before the eval row:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval to=fillnull(to,"-"), from=fillnull(from,"-"), user=fillnull(user,"-")
| eval email=to."--".from."--".user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;otherwise the eval command doesn't run.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 11:01:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-fields/m-p/465040#M131033</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-02-13T11:01:28Z</dc:date>
    </item>
  </channel>
</rss>

