<?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: Dynamic table with missing event in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Dynamic-table-with-missing-event/m-p/359997#M5841</link>
    <description>&lt;P&gt;Can you provide sample data ? When you write &lt;CODE&gt;| stats count by destination&lt;/CODE&gt; , are you getting missing events?&lt;/P&gt;</description>
    <pubDate>Thu, 15 Mar 2018 13:03:40 GMT</pubDate>
    <dc:creator>p_gurav</dc:creator>
    <dc:date>2018-03-15T13:03:40Z</dc:date>
    <item>
      <title>Dynamic table with missing event</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Dynamic-table-with-missing-event/m-p/359996#M5840</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;I am building a table with some metrics on the http access to different services reported in the apache WAF logs. &lt;BR /&gt;
I use the field extraction to build the table dynamically and display the number of hits to each service. &lt;/P&gt;

&lt;P&gt;index=apache-access | eval destination=split(...) | table count by destination&lt;/P&gt;

&lt;P&gt;If there is no traffic on a specific destination, it does not appear in the table. However i would like to show count 0 to initiate a warning that there is no traffic. I do not want to do a targeted search on each service as it could generate 100s of searches.&lt;/P&gt;

&lt;P&gt;How can i achieve the above with a static column to declare the expected services and then have dynamic count in the second column linked to those services&lt;/P&gt;

&lt;P&gt;Prateesh&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 12:30:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Dynamic-table-with-missing-event/m-p/359996#M5840</guid>
      <dc:creator>c_prateesh</dc:creator>
      <dc:date>2018-03-15T12:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table with missing event</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Dynamic-table-with-missing-event/m-p/359997#M5841</link>
      <description>&lt;P&gt;Can you provide sample data ? When you write &lt;CODE&gt;| stats count by destination&lt;/CODE&gt; , are you getting missing events?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 13:03:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Dynamic-table-with-missing-event/m-p/359997#M5841</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-03-15T13:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table with missing event</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Dynamic-table-with-missing-event/m-p/359998#M5842</link>
      <description>&lt;P&gt;Presumably, you have a pre-defined list of services that you'd expect to see in the table (or else you wouldn't notice they were missing). I'd recommend collecting those in a single-column csv file - perhaps &lt;CODE&gt;apache_services.csv&lt;/CODE&gt; - with a field header of &lt;CODE&gt;destination&lt;/CODE&gt; (to match your query structure above) and create a lookup from this file in Splunk. Then you can do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=apache-access 
| eval destination=split(...) 
| stats count by destination
| append 
 [| inputlookup apache_services.csv
  | eval count=0 ]
| stats max(count) AS count BY destination
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will allow you to first count the number of hits per destination in the log file, then append the list of &lt;EM&gt;possible&lt;/EM&gt; services from the lookup file, with a presumed count of 0. The final stats call will pick up the higher &lt;CODE&gt;count&lt;/CODE&gt; value if it was found in the logs.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 13:51:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Dynamic-table-with-missing-event/m-p/359998#M5842</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-03-15T13:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table with missing event</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Dynamic-table-with-missing-event/m-p/359999#M5843</link>
      <description>&lt;P&gt;Lets assume i have 3 services serviceA, serviceB, serviceC&lt;/P&gt;

&lt;P&gt;In my logs i have (Note: i have no logs for serviceC during the timeframe i selected. &lt;BR /&gt;
uri=/serviceA/xyz/..&lt;BR /&gt;
uri=/serviceA/def/..&lt;BR /&gt;
uri=/serviceB/abc/..&lt;/P&gt;

&lt;P&gt;so when i search and parse i get the following result &lt;BR /&gt;
serviceA : 2&lt;BR /&gt;
serviceB : 1&lt;/P&gt;

&lt;P&gt;What i want is &lt;BR /&gt;
serviceA : 2&lt;BR /&gt;
serviceB : 1&lt;BR /&gt;
serviceC : 0&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 13:55:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Dynamic-table-with-missing-event/m-p/359999#M5843</guid>
      <dc:creator>c_prateesh</dc:creator>
      <dc:date>2018-03-15T13:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table with missing event</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Dynamic-table-with-missing-event/m-p/360000#M5844</link>
      <description>&lt;P&gt;Thanks a lot. It works well. &lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 14:25:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Dynamic-table-with-missing-event/m-p/360000#M5844</guid>
      <dc:creator>c_prateesh</dc:creator>
      <dc:date>2018-03-15T14:25:06Z</dc:date>
    </item>
  </channel>
</rss>

