<?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: splunk search giving same results in table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-giving-same-results-in-table/m-p/317988#M95142</link>
    <description>&lt;P&gt;Hello,  leomedina&lt;/P&gt;

&lt;P&gt;It looks that you should correct stats statement because now you count the same in first search and after append &lt;/P&gt;

&lt;P&gt;1.&lt;CODE&gt;index=datapower ApplicationName="mpgw(OAuth-subscription)" "HTTP response code"&lt;BR /&gt;
 ...&lt;BR /&gt;
 | stats count as Success by ApplicationName&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;2.&lt;CODE&gt;[search index=datapower ApplicationName="mpgw(OAuth-subscription)" "HTTP response code" &lt;BR /&gt;
 | stats count as Errors by ApplicationName]&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;but rename in different ways Success and Errors&lt;/P&gt;

&lt;P&gt;May be you should try something like this to specify some way in first case only success and in second only errors&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=datapower ApplicationName="mpgw(OAuth-subscription)" "HTTP response code"
 | lookup http_response_codes.csv response_code OUTPUT description
 | search description="*success*"
 | stats count as Success by ApplicationName
 | append [search index=datapower ApplicationName="mpgw(OAuth-subscription)" "HTTP response code" 
 | lookup http_response_codes.csv response_code OUTPUT description
 | search description="*error*"
 | stats count as Errors by ApplicationName]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 11 Apr 2017 07:35:51 GMT</pubDate>
    <dc:creator>andrey2007</dc:creator>
    <dc:date>2017-04-11T07:35:51Z</dc:date>
    <item>
      <title>splunk search giving same results in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-giving-same-results-in-table/m-p/317987#M95141</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;The below search is producing the same data for success and errors...  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=datapower ApplicationName="mpgw(OAuth-subscription)" "HTTP response code"
| lookup http_response_codes.csv response_code OUTPUT description
| stats count as Success by ApplicationName
| append [search index=datapower ApplicationName="mpgw(OAuth-subscription)" "HTTP response code" 
| stats count as Errors by ApplicationName]
| stats values(Success) as Success, values(Errors) as Errors by ApplicationName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;1)  How can I make this query output the data where it needs?  Do I need to create multiple lookups (one for successful and one for errors)? My http_response_codes.csv has a ton of response codes.  If so, how would that search look like?  Greatly appreciate the help.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:36:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-giving-same-results-in-table/m-p/317987#M95141</guid>
      <dc:creator>leomedina</dc:creator>
      <dc:date>2020-09-29T13:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search giving same results in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-giving-same-results-in-table/m-p/317988#M95142</link>
      <description>&lt;P&gt;Hello,  leomedina&lt;/P&gt;

&lt;P&gt;It looks that you should correct stats statement because now you count the same in first search and after append &lt;/P&gt;

&lt;P&gt;1.&lt;CODE&gt;index=datapower ApplicationName="mpgw(OAuth-subscription)" "HTTP response code"&lt;BR /&gt;
 ...&lt;BR /&gt;
 | stats count as Success by ApplicationName&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;2.&lt;CODE&gt;[search index=datapower ApplicationName="mpgw(OAuth-subscription)" "HTTP response code" &lt;BR /&gt;
 | stats count as Errors by ApplicationName]&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;but rename in different ways Success and Errors&lt;/P&gt;

&lt;P&gt;May be you should try something like this to specify some way in first case only success and in second only errors&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=datapower ApplicationName="mpgw(OAuth-subscription)" "HTTP response code"
 | lookup http_response_codes.csv response_code OUTPUT description
 | search description="*success*"
 | stats count as Success by ApplicationName
 | append [search index=datapower ApplicationName="mpgw(OAuth-subscription)" "HTTP response code" 
 | lookup http_response_codes.csv response_code OUTPUT description
 | search description="*error*"
 | stats count as Errors by ApplicationName]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Apr 2017 07:35:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-giving-same-results-in-table/m-p/317988#M95142</guid>
      <dc:creator>andrey2007</dc:creator>
      <dc:date>2017-04-11T07:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search giving same results in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-giving-same-results-in-table/m-p/317989#M95143</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=datapower ApplicationName="mpgw(OAuth-subscription)" "HTTP response code"
| lookup http_response_codes.csv response_code OUTPUT description
| stats count(eval(match(description, "success"))) AS Success count(eval(match(description, "error"))) AS Errors BY ApplicationName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Apr 2017 14:23:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-giving-same-results-in-table/m-p/317989#M95143</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-04-11T14:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search giving same results in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-giving-same-results-in-table/m-p/317990#M95144</link>
      <description>&lt;P&gt;Thank you Mr. Woodcock!&lt;/P&gt;

&lt;P&gt;I made some minor modifications on my end but your guidance led me there.  I ended up creating a new lookup csv with the status of success or fail in a separate column next to the http codes and was then able to use the above query.&lt;/P&gt;

&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 16:11:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-giving-same-results-in-table/m-p/317990#M95144</guid>
      <dc:creator>leomedina</dc:creator>
      <dc:date>2017-04-11T16:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search giving same results in table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-giving-same-results-in-table/m-p/317991#M95145</link>
      <description>&lt;P&gt;Be sure to &lt;CODE&gt;Upvote&lt;/CODE&gt; any helpful answers and click &lt;CODE&gt;Accept&lt;/CODE&gt; on the best one to close the Question and let others know what worked.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 18:31:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-giving-same-results-in-table/m-p/317991#M95145</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-04-11T18:31:56Z</dc:date>
    </item>
  </channel>
</rss>

