<?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 Combine fields into new field without NULL in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Combine-fields-into-new-field-without-NULL/m-p/218140#M188022</link>
    <description>&lt;P&gt;From our data we end up with 2 different fields v7serial &amp;amp; v8serial. I want to be able to feed this into a single serial v78serial.&lt;/P&gt;

&lt;P&gt;Example of data&lt;BR /&gt;
v7serial&lt;BR /&gt;
987654321&lt;/P&gt;

&lt;P&gt;v8serial&lt;BR /&gt;
123456789&lt;/P&gt;

&lt;P&gt;v78serial&lt;BR /&gt;
123456789&lt;BR /&gt;
987654321&lt;/P&gt;

&lt;P&gt;I am trying&lt;/P&gt;

&lt;P&gt;| eval v78serial= toString(v8serial) + ";" + toString(v7serial) &lt;BR /&gt;
| makemv delim=";" allserials&lt;BR /&gt;
| mvexpand v78serial | table v78serial&lt;/P&gt;

&lt;P&gt;The problem is when i display this data or try to use this field i get "123456789;null" this is because the data has either a v7 or v8 serial never both. So where one field is Null then don't add it to the new field. &lt;/P&gt;</description>
    <pubDate>Thu, 23 Jun 2016 15:51:07 GMT</pubDate>
    <dc:creator>arrowecssupport</dc:creator>
    <dc:date>2016-06-23T15:51:07Z</dc:date>
    <item>
      <title>Combine fields into new field without NULL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-fields-into-new-field-without-NULL/m-p/218140#M188022</link>
      <description>&lt;P&gt;From our data we end up with 2 different fields v7serial &amp;amp; v8serial. I want to be able to feed this into a single serial v78serial.&lt;/P&gt;

&lt;P&gt;Example of data&lt;BR /&gt;
v7serial&lt;BR /&gt;
987654321&lt;/P&gt;

&lt;P&gt;v8serial&lt;BR /&gt;
123456789&lt;/P&gt;

&lt;P&gt;v78serial&lt;BR /&gt;
123456789&lt;BR /&gt;
987654321&lt;/P&gt;

&lt;P&gt;I am trying&lt;/P&gt;

&lt;P&gt;| eval v78serial= toString(v8serial) + ";" + toString(v7serial) &lt;BR /&gt;
| makemv delim=";" allserials&lt;BR /&gt;
| mvexpand v78serial | table v78serial&lt;/P&gt;

&lt;P&gt;The problem is when i display this data or try to use this field i get "123456789;null" this is because the data has either a v7 or v8 serial never both. So where one field is Null then don't add it to the new field. &lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 15:51:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-fields-into-new-field-without-NULL/m-p/218140#M188022</guid>
      <dc:creator>arrowecssupport</dc:creator>
      <dc:date>2016-06-23T15:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: Combine fields into new field without NULL</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-fields-into-new-field-without-NULL/m-p/218141#M188023</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | eval v78serial=coalesce(v8serial,v7serial,"")  | table v78serial
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Jun 2016 16:01:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-fields-into-new-field-without-NULL/m-p/218141#M188023</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-23T16:01:32Z</dc:date>
    </item>
  </channel>
</rss>

