<?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: Create one field from many, even when some fields don't exist in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Create-one-field-from-many-even-when-some-fields-don-t-exist/m-p/177236#M50942</link>
    <description>&lt;P&gt;Yes just use it likt this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;fillnull value="whateveryouneed" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you don't provide any field as fillnull option, fillnull will use all available fileds&lt;/P&gt;</description>
    <pubDate>Fri, 23 May 2014 15:28:25 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2014-05-23T15:28:25Z</dc:date>
    <item>
      <title>Create one field from many, even when some fields don't exist</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-one-field-from-many-even-when-some-fields-don-t-exist/m-p/177233#M50939</link>
      <description>&lt;P&gt;Ok, so I understand how to eval something like this:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;index=mystuff | eval&lt;BR /&gt;
NewBigField=firstname + "-" + lastname&lt;BR /&gt;
+ "-" + phonenumber&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;But there is a problem. Not all events will have "phonenumber" in them. This breaks the eval, so NewBigField gets populated with nothing instead of just firstname and lastname.&lt;/P&gt;

&lt;P&gt;Going one step further, there are around &lt;STRONG&gt;50&lt;/STRONG&gt; fields like phone number that may or may not exist in an event which I need to put into one big field with an eval. &lt;/P&gt;

&lt;P&gt;What is the easiest way to create this new big field in a working fashion with dynamic fields? The only current option I see right now is 50 coalesce statements which is unacceptable.&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2014 14:45:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-one-field-from-many-even-when-some-fields-don-t-exist/m-p/177233#M50939</guid>
      <dc:creator>thisissplunk</dc:creator>
      <dc:date>2014-05-23T14:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create one field from many, even when some fields don't exist</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-one-field-from-many-even-when-some-fields-don-t-exist/m-p/177234#M50940</link>
      <description>&lt;P&gt;Hi thisissplunk,&lt;/P&gt;

&lt;P&gt;use &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.1/SearchReference/Fillnull"&gt;&lt;CODE&gt;fillnull&lt;/CODE&gt;&lt;/A&gt; like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=mystuff | fillnull value="no number" phonenumber | eval NewBigField=firstname + "-" + lastname + "-" + phonenumber
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2014 14:58:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-one-field-from-many-even-when-some-fields-don-t-exist/m-p/177234#M50940</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-23T14:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create one field from many, even when some fields don't exist</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-one-field-from-many-even-when-some-fields-don-t-exist/m-p/177235#M50941</link>
      <description>&lt;P&gt;Seems like this will work, but is there any way to accomplish my goal without adding 50 extra statements (one for every possible field)? Maybe something like&lt;/P&gt;

&lt;P&gt;fillnull value="no number" *&lt;/P&gt;

&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2014 15:05:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-one-field-from-many-even-when-some-fields-don-t-exist/m-p/177235#M50941</guid>
      <dc:creator>thisissplunk</dc:creator>
      <dc:date>2014-05-23T15:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create one field from many, even when some fields don't exist</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-one-field-from-many-even-when-some-fields-don-t-exist/m-p/177236#M50942</link>
      <description>&lt;P&gt;Yes just use it likt this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;fillnull value="whateveryouneed" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you don't provide any field as fillnull option, fillnull will use all available fileds&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2014 15:28:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-one-field-from-many-even-when-some-fields-don-t-exist/m-p/177236#M50942</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-23T15:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Create one field from many, even when some fields don't exist</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-one-field-from-many-even-when-some-fields-don-t-exist/m-p/177237#M50943</link>
      <description>&lt;P&gt;This is great and I'll be testing soon. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2014 15:33:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-one-field-from-many-even-when-some-fields-don-t-exist/m-p/177237#M50943</guid>
      <dc:creator>thisissplunk</dc:creator>
      <dc:date>2014-05-23T15:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create one field from many, even when some fields don't exist</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-one-field-from-many-even-when-some-fields-don-t-exist/m-p/177238#M50944</link>
      <description>&lt;P&gt;So to complicate this further, these fields are not actually fields. They are being extracted by Splunk and displayed as fields on the left hand column. In reality they are bits and peices taken out of a huge field in the event.&lt;/P&gt;

&lt;P&gt;Fillnull can't work because when a field like phonenumber is empty at the source, it is never brought into Splunk in the first place. Arg. Sounds like I'll need to get with our Splunk guys.&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2014 19:40:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-one-field-from-many-even-when-some-fields-don-t-exist/m-p/177238#M50944</guid>
      <dc:creator>thisissplunk</dc:creator>
      <dc:date>2014-05-23T19:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create one field from many, even when some fields don't exist</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-one-field-from-many-even-when-some-fields-don-t-exist/m-p/177239#M50945</link>
      <description>&lt;P&gt;I have to post this as new answer, since it is too big for a comment &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Take this run everywhere example based on two field extractions using regex and it works perfectly:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | head 1 | eval myFoo="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas lorem eros, vehicula sed justo at, feugiat imperdiet arcu. Phasellus auctor mauris sapien, eget eleifend ante mollis eget. Aliquam id leo aliquam, auctor quam et, sollicitudin mauris. Pellentesque sagittis molestie quam. Aenean eu aliquet nisl. Donec ornare nisl ipsum, sed ultricies sapien varius nec. Mauris arcu quam, interdum in tincidunt et, ultrices in nisl. Sed et quam justo. Vestibulum imperdiet, neque ut consequat sodales, ipsum neque euismod massa, vel dignissim quam felis sed massa. Sed lacinia velit et lorem interdum venenatis. Pellentesque a blandit ipsum, in interdum lorem. Etiam risus lorem, facilisis eu mauris eget, porta viverra nulla." | rex field=myFoo "\w+\s(?&amp;lt;myRex&amp;gt;\w+)\s" | rex field=myFoo "\d+\s(?&amp;lt;myNotRex&amp;gt;\w+)\s" | fillnull value="no hit" | table myRex myNotRex
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this will return a table like this image below, where the field &lt;CODE&gt;myNotRex&lt;/CODE&gt; with the not matching regex will be filled by &lt;CODE&gt;fillnull&lt;/CODE&gt; using the value &lt;CODE&gt;"no hit"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://answers.splunk.com//storage/Bildschirmfoto_2014-05-23_um_22.11.01.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2014 20:14:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-one-field-from-many-even-when-some-fields-don-t-exist/m-p/177239#M50945</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-05-23T20:14:06Z</dc:date>
    </item>
  </channel>
</rss>

