<?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 add a count column in the table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/add-a-count-column-in-the-table/m-p/315344#M175371</link>
    <description>&lt;P&gt;Hi All. &lt;/P&gt;

&lt;P&gt;I want to add an additional column in the table to display how many times a particular host in the set time frame had a distinct hit based on the search query below. Can anyo0ne advise how I can add it to the table? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;index=nm "RPD_OSPF_NBR*" host=$hostname2$ syslog_message!="*ExStart due to*" syslog_message!="*UI_CMDLINE_READ_LINE*" | dedup syslog_message | table _time, host, ip, state, syslog_message | sort 0 -_time&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;$_time.earliest$&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;$_time.latest$&amp;lt;/latest&amp;gt;
    &amp;lt;/search&amp;gt;
    &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 22 Feb 2017 23:22:52 GMT</pubDate>
    <dc:creator>ringbbg</dc:creator>
    <dc:date>2017-02-22T23:22:52Z</dc:date>
    <item>
      <title>add a count column in the table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-a-count-column-in-the-table/m-p/315344#M175371</link>
      <description>&lt;P&gt;Hi All. &lt;/P&gt;

&lt;P&gt;I want to add an additional column in the table to display how many times a particular host in the set time frame had a distinct hit based on the search query below. Can anyo0ne advise how I can add it to the table? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;index=nm "RPD_OSPF_NBR*" host=$hostname2$ syslog_message!="*ExStart due to*" syslog_message!="*UI_CMDLINE_READ_LINE*" | dedup syslog_message | table _time, host, ip, state, syslog_message | sort 0 -_time&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;$_time.earliest$&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;$_time.latest$&amp;lt;/latest&amp;gt;
    &amp;lt;/search&amp;gt;
    &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Feb 2017 23:22:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-a-count-column-in-the-table/m-p/315344#M175371</guid>
      <dc:creator>ringbbg</dc:creator>
      <dc:date>2017-02-22T23:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: add a count column in the table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-a-count-column-in-the-table/m-p/315345#M175372</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=nm "RPD_OSPF_NBR*" host=$hostname2$ syslog_message!="*ExStart due to*" syslog_message!="*UI_CMDLINE_READ_LINE*" | stats count max(_time) AS _time BY host ip state syslog_message | sort 0 -_time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Feb 2017 00:14:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-a-count-column-in-the-table/m-p/315345#M175372</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-02-23T00:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: add a count column in the table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-a-count-column-in-the-table/m-p/315346#M175373</link>
      <description>&lt;P&gt;thanks! is there a way to rearrange the order of the column? with the syntax above, the _time column is at the rightmost part of the table. I would like it to be in the left most side, or the first column. Thanks &lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 01:47:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-a-count-column-in-the-table/m-p/315346#M175373</guid>
      <dc:creator>ringbbg</dc:creator>
      <dc:date>2017-02-23T01:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: add a count column in the table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/add-a-count-column-in-the-table/m-p/315347#M175374</link>
      <description>&lt;P&gt;Just add &lt;CODE&gt;| table Your Preferred Order Of Field Names Here&lt;/CODE&gt;.  Be sure to click &lt;CODE&gt;Accept&lt;/CODE&gt; to close the question if the answer worked for you.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 03:02:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/add-a-count-column-in-the-table/m-p/315347#M175374</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-02-23T03:02:18Z</dc:date>
    </item>
  </channel>
</rss>

