<?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 How to edit my search to add row header labels to the table of results? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251507#M75149</link>
    <description>&lt;P&gt;I have created following Splunk search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=xyz* index=my_index NOT(bot) earliest=-1d@d latest=-0d@d | eval searchid="Today" | stats count(eval(searchmatch("Exception"))) as Exceptions count(eval(searchmatch("Error"))) as Errors count(eval(searchmatch("404"))) as 404 | append [ search index=my_index host=pdap* index=os_web NOT(bot) earliest=-2d@d latest=-1d@d |eval searchid="Yesterday" | stats count(eval(searchmatch("Exception"))) as Exceptions count(eval(searchmatch("Error"))) as Errors count(eval(searchmatch("404"))) as 404]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is the result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Exceptions              Errors             404
58                      95                 49
59                      135               94
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My Question is: How do I add row labels like Today for first row and Yesterday for second row?&lt;/P&gt;</description>
    <pubDate>Wed, 30 Nov 2016 07:51:50 GMT</pubDate>
    <dc:creator>vivekb</dc:creator>
    <dc:date>2016-11-30T07:51:50Z</dc:date>
    <item>
      <title>How to edit my search to add row header labels to the table of results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251507#M75149</link>
      <description>&lt;P&gt;I have created following Splunk search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=xyz* index=my_index NOT(bot) earliest=-1d@d latest=-0d@d | eval searchid="Today" | stats count(eval(searchmatch("Exception"))) as Exceptions count(eval(searchmatch("Error"))) as Errors count(eval(searchmatch("404"))) as 404 | append [ search index=my_index host=pdap* index=os_web NOT(bot) earliest=-2d@d latest=-1d@d |eval searchid="Yesterday" | stats count(eval(searchmatch("Exception"))) as Exceptions count(eval(searchmatch("Error"))) as Errors count(eval(searchmatch("404"))) as 404]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is the result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Exceptions              Errors             404
58                      95                 49
59                      135               94
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My Question is: How do I add row labels like Today for first row and Yesterday for second row?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 07:51:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251507#M75149</guid>
      <dc:creator>vivekb</dc:creator>
      <dc:date>2016-11-30T07:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to add row header labels to the table of results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251508#M75150</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=xyz* index=my_index NOT(bot) earliest=-2d@d latest=-0d@d 
| eval searchid=if(_time&amp;lt;relative_time(now(), "-1d@d"), "Today", "Yesterday")
| stats count(eval(searchmatch("Exception"))) as Exceptions count(eval(searchmatch("Error"))) as Errors count(eval(searchmatch("404"))) as 404 by searchid
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Nov 2016 12:45:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251508#M75150</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-11-30T12:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to add row header labels to the table of results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251509#M75151</link>
      <description>&lt;P&gt;You can combine this into a single search, but the important part is the &lt;CODE&gt;by&lt;/CODE&gt; clause.&lt;/P&gt;

&lt;P&gt;As you have it written:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; host=xyz* index=my_index NOT(bot) earliest=-1d@d latest=-0d@d | eval searchid="Today" | stats count(eval(searchmatch("Exception"))) as Exceptions count(eval(searchmatch("Error"))) as Errors count(eval(searchmatch("404"))) as 404 by searchid | append [ search index=my_index host=pdap* index=os_web NOT(bot) earliest=-2d@d latest=-1d@d |eval searchid="Yesterday" | stats count(eval(searchmatch("Exception"))) as Exceptions count(eval(searchmatch("Error"))) as Errors count(eval(searchmatch("404"))) as 404 by searchid]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As I would write it combined:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index host=pdap* index=os_web NOT(bot) earliest=-2d@d  latest=-0d@d |eval searchid=if(_time&amp;gt;relative_time(now(),"-1d@d"),"Today", "Yesterday")| stats count(eval(searchmatch("Exception"))) as Exceptions count(eval(searchmatch("Error"))) as Errors count(eval(searchmatch("404"))) as 404 by searchid
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Nov 2016 12:49:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251509#M75151</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2016-11-30T12:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to add row header labels to the table of results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251510#M75152</link>
      <description>&lt;P&gt;Thanks a bunch. Saved my day.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 14:34:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251510#M75152</guid>
      <dc:creator>vivekb</dc:creator>
      <dc:date>2016-11-30T14:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to add row header labels to the table of results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251511#M75153</link>
      <description>&lt;P&gt;Thanks much.  Perfect answer similar to what @sundareshr has posted. Since I can accept only one answer, I picked the first one. Thanks again.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 14:36:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251511#M75153</guid>
      <dc:creator>vivekb</dc:creator>
      <dc:date>2016-11-30T14:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to add row header labels to the table of results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251512#M75154</link>
      <description>&lt;P&gt;Thanks again.  @sundeshOne extension to the query - Since relative_time function accepts two arguments - &lt;BR /&gt;
How do I extrapolate to last 7 days?&lt;BR /&gt;&lt;BR /&gt;
E.g.&lt;BR /&gt;
Today&lt;BR /&gt;
Yesterday&lt;BR /&gt;
&lt;STRONG&gt;2 Days Prior&lt;/STRONG&gt;&lt;BR /&gt;
&lt;STRONG&gt;3 Days Prior&lt;/STRONG&gt; &lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 14:47:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251512#M75154</guid>
      <dc:creator>vivekb</dc:creator>
      <dc:date>2016-11-30T14:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to add row header labels to the table of results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251513#M75155</link>
      <description>&lt;P&gt;Hi @vivekb&lt;/P&gt;

&lt;P&gt;Don't forget to resolve your question by clicking "Accept" below the answer you decided to go with!&lt;/P&gt;

&lt;P&gt;Patrick&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 02:08:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251513#M75155</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2016-12-01T02:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to add row header labels to the table of results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251514#M75156</link>
      <description>&lt;P&gt;Done. Thanks Patrick!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 11:50:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251514#M75156</guid>
      <dc:creator>vivekb</dc:creator>
      <dc:date>2016-12-01T11:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to add row header labels to the table of results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251515#M75157</link>
      <description>&lt;P&gt;You could do &lt;CODE&gt;searchid=round((now()-_time)/86400, 0)." days"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 12:46:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-add-row-header-labels-to-the-table-of/m-p/251515#M75157</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-12-01T12:46:27Z</dc:date>
    </item>
  </channel>
</rss>

