<?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: How do I get an automatic lookup to populate a table, even if there are null values in the event logs for the matching field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264589#M79419</link>
    <description>&lt;P&gt;I think the moderator edited my post title/Question which I don't feel is accurate to my problem. Please refer to the actual body of my post. Thanks.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Dec 2015 19:45:48 GMT</pubDate>
    <dc:creator>cchimento</dc:creator>
    <dc:date>2015-12-07T19:45:48Z</dc:date>
    <item>
      <title>How do I get an automatic lookup to populate a table, even if there are null values in the event logs for the matching field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264587#M79417</link>
      <description>&lt;P&gt;Hello - This is my first time asking a question here. I receive a lot of answers by reading others' questions (thank you) so hopefully you can understand that I have done my fare share of searching before typing this all out. So here we go....&lt;/P&gt;

&lt;P&gt;Assume that I have a fully functioning automated lookup using a CSV. &lt;/P&gt;

&lt;P&gt;3 fields; &lt;STRONG&gt;location&lt;/STRONG&gt;, &lt;STRONG&gt;number&lt;/STRONG&gt;, &lt;STRONG&gt;group&lt;/STRONG&gt;   [which is used for call counts for each location/number]&lt;/P&gt;

&lt;P&gt;The event logs populate the &lt;STRONG&gt;number&lt;/STRONG&gt; field and the lookup populates the &lt;STRONG&gt;location&lt;/STRONG&gt; &amp;amp; &lt;STRONG&gt;group&lt;/STRONG&gt; fields. &lt;/P&gt;

&lt;P&gt;What happens is that, if there are no events that have the &lt;STRONG&gt;number&lt;/STRONG&gt; as listed in the table - it will not populate the &lt;STRONG&gt;location&lt;/STRONG&gt;/&lt;STRONG&gt;group&lt;/STRONG&gt; and call count (event count) for that entry.  So for example..  Group A I have a complete list, as it is in the lookup because all numbers show up in the event logs.  However, for Group B I don't have a full list because some of the numbers needed to populate the lookup are not present in the logs. So splunk will not list those locations in the table as there is essentially nothing to look up.&lt;/P&gt;

&lt;P&gt;What I want is to have the complete list (as from the csv) listed in the table regardless if the lookup finds it or not and then if there are no matches for numbers, populate a 0 (zero) value for the table. &lt;/P&gt;

&lt;P&gt;Location  - Number - Group - Calls&lt;BR /&gt;
A ------------1------------- A --------- 4&lt;BR /&gt;
B------------2 --------------A-----------5&lt;BR /&gt;
A------------3---------------B-----------3&lt;BR /&gt;
B ---------- 4 ---------------B---------- 0    &amp;lt;----- I want zero value because the number was not found in the logs. &lt;/P&gt;

&lt;P&gt;I think that I might want to do a reverse look up? But something tells me there may be a very simple way to do this. &lt;/P&gt;

&lt;P&gt;Thanks for your time, I look forward you your help!&lt;/P&gt;

&lt;P&gt;-Chris&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 19:05:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264587#M79417</guid>
      <dc:creator>cchimento</dc:creator>
      <dc:date>2015-12-07T19:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get an automatic lookup to populate a table, even if there are null values in the event logs for the matching field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264588#M79418</link>
      <description>&lt;P&gt;The community should probably see your search to offer suggestions, but I am going to give it a guess here:&lt;/P&gt;

&lt;P&gt;If you are searching like this, with an automatic lookup:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere | stats count as Calls by Location Number Group
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You could do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere | stats count as Calls by Location Number Group
| append [ inputlookup yourLookupNamehere | eval Calls = 0 ]
| stats sum(Calls) as Calls by Location Number Group
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;append&lt;/CODE&gt; will "fill in" the cells with a zero value for Calls, and then the final stats combines it with the original results.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 19:42:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264588#M79418</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-12-07T19:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get an automatic lookup to populate a table, even if there are null values in the event logs for the matching field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264589#M79419</link>
      <description>&lt;P&gt;I think the moderator edited my post title/Question which I don't feel is accurate to my problem. Please refer to the actual body of my post. Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 19:45:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264589#M79419</guid>
      <dc:creator>cchimento</dc:creator>
      <dc:date>2015-12-07T19:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get an automatic lookup to populate a table, even if there are null values in the event logs for the matching field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264590#M79420</link>
      <description>&lt;P&gt;Okay, but does my answer work? I think it should. Also, it would still be helpful to see your search (even sanitized).&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 22:19:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264590#M79420</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-12-07T22:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get an automatic lookup to populate a table, even if there are null values in the event logs for the matching field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264591#M79421</link>
      <description>&lt;P&gt;If any of the fields in missing a value then you can fill the value you want useing the fillnull command like this&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;your search | fillnull value=0 Calls Location Number Group | Stats count by ...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;this will fill any log that does not have a value for the field to "0"&lt;/P&gt;

&lt;P&gt;if you want to fill only the Calls field with the "0" then leave out the other fields or creat another &lt;CODE&gt;|fillnull value=&lt;/CODE&gt;  for the other fields&lt;/P&gt;

&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2015 13:00:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264591#M79421</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2015-12-08T13:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get an automatic lookup to populate a table, even if there are null values in the event logs for the matching field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264592#M79422</link>
      <description>&lt;P&gt;Thank you - This worked for me however I have another issue based on these new results. &lt;/P&gt;

&lt;P&gt;Before I was using a pivot table to manipulate this data. Very early in my development on these particular logs so I am playing with things. Using your method &lt;STRONG&gt;Iguinn&lt;/STRONG&gt;, I see numbers populate with a 0 value for the number of calls. But because my CSV has all three "groups" it pulls zeros for every entry in the CSV that didn't pull a result... despite having specified a specific 'group' in my search.  Currently, the way I see around this is to create 3 separate look ups for each group as opposed to one although I don't want to. Base on your method, how can I only display results from specific groups? Can I selectively pull info from a lookup?&lt;/P&gt;

&lt;P&gt;My search:&lt;BR /&gt;
&lt;CODE&gt;index=ast sourcetype=poc_agi_logs number=* group="FAA" | stats count as Calls by location number group&lt;BR /&gt;
 | append [ inputlookup faadid.csv | eval Calls = 0 ] | stats sum(Calls) as Calls by location number group&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;My CSV (snipit)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;location,number,group
UK,3785,FAA
SPAIN,5301,FAA
FRANCE,5081,FAA
ITALY,0025,FAA
UK,3786,FAB
SPAIN,5302,FAB
FRANCE,5082,FAB
ITALY,0026,FAB
UK,0615,EP
SPAIN,8165,EP
FRANCE,4984,EP
ITALY,0098,EP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Results for searching group FAA will return zeros for the locations and numbers in FAB and EP as well. I don't want that. Does that make sense?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2015 15:33:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264592#M79422</guid>
      <dc:creator>cchimento</dc:creator>
      <dc:date>2015-12-08T15:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get an automatic lookup to populate a table, even if there are null values in the event logs for the matching field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264593#M79423</link>
      <description>&lt;P&gt;Thank you - but this did not work for me. &lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2015 15:34:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264593#M79423</guid>
      <dc:creator>cchimento</dc:creator>
      <dc:date>2015-12-08T15:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get an automatic lookup to populate a table, even if there are null values in the event logs for the matching field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264594#M79424</link>
      <description>&lt;P&gt;Let me try again with a variation of my earlier answer. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ast sourcetype=poc_agi_logs number=* group="FAA" 
| stats count as Calls by location number group 
| append [ inputlookup faadid.csv | where group="FAA" | eval Calls = 0 ] 
| stats sum(Calls) as Calls by location number group
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Notice the &lt;CODE&gt;where&lt;/CODE&gt; command that follows the &lt;CODE&gt;inputlookup&lt;/CODE&gt; - this will select only the FAA group and set it to zero. I think this will work. Thanks for the clarifying comment!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 00:18:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264594#M79424</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-12-09T00:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get an automatic lookup to populate a table, even if there are null values in the event logs for the matching field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264595#M79425</link>
      <description>&lt;P&gt;Ya know I did try that and failed, but I didn't put the | before "where". That must have been it. I will have to try this later on or tomorrow. Thank you again and I will update after I try. &lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 20:46:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264595#M79425</guid>
      <dc:creator>cchimento</dc:creator>
      <dc:date>2015-12-09T20:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get an automatic lookup to populate a table, even if there are null values in the event logs for the matching field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264596#M79426</link>
      <description>&lt;P&gt;Hi Iguinn - happy new year. Finally able to work this and it indeed worked for me. Thank you so much for your help. &lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 01:04:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-get-an-automatic-lookup-to-populate-a-table-even-if/m-p/264596#M79426</guid>
      <dc:creator>cchimento</dc:creator>
      <dc:date>2016-01-08T01:04:29Z</dc:date>
    </item>
  </channel>
</rss>

