<?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 Distinct count of one field when second field matches string %200% in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-one-field-when-second-field-matches-string-200/m-p/87677#M22414</link>
    <description>&lt;P&gt;Hi I am trying two get distinct count of field1 when field2 contains string 200, 500, 400 etc  and i am trying to summary index it. i cannot dedup it before eval function as same field1 value can exist in for another response&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval response=case(rsppcode LIKE "%200%", 200,     rsppcode LIKE "%401%", 401, 
                   rsppcode LIKE "%403%", 403,     rsppcode LIKE "%404%", 404, 
                   rsppcode LIKE "%409%", 409,    rsppcode LIKE "%504%", 504, 
                   rsppcode LIKE "%500%", 500,     rsppcode LIKE "%422%", 422,
                   rsppcode LIKE "%550%", 550,    rsppcode LIKE "%", Others ) 
| timechart span=5min dc(field1) by response
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;tried this one but when summaryindexed. it was unable to  recognise response field as it is eval field. all response count is under null.&lt;/P&gt;

&lt;P&gt;Normal output&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time                       200  401    403 404 409 422 500 504 NULL
1   4/8/13 9:40:00.000 AM   2151    2   9   87              9   108
2   4/8/13 9:45:00.000 AM   2746    10  17  333 4   2       41  862
3   4/8/13 9:50:00.000 AM   2770    11  17  359     2       49  827
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;output from summaryindex &lt;/P&gt;

&lt;P&gt;time  nulll&lt;BR /&gt;
somevalue   somevalue&lt;/P&gt;

&lt;P&gt;Please advise..&lt;/P&gt;</description>
    <pubDate>Mon, 08 Apr 2013 17:50:46 GMT</pubDate>
    <dc:creator>praveenvemuri</dc:creator>
    <dc:date>2013-04-08T17:50:46Z</dc:date>
    <item>
      <title>Distinct count of one field when second field matches string %200%</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-one-field-when-second-field-matches-string-200/m-p/87677#M22414</link>
      <description>&lt;P&gt;Hi I am trying two get distinct count of field1 when field2 contains string 200, 500, 400 etc  and i am trying to summary index it. i cannot dedup it before eval function as same field1 value can exist in for another response&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval response=case(rsppcode LIKE "%200%", 200,     rsppcode LIKE "%401%", 401, 
                   rsppcode LIKE "%403%", 403,     rsppcode LIKE "%404%", 404, 
                   rsppcode LIKE "%409%", 409,    rsppcode LIKE "%504%", 504, 
                   rsppcode LIKE "%500%", 500,     rsppcode LIKE "%422%", 422,
                   rsppcode LIKE "%550%", 550,    rsppcode LIKE "%", Others ) 
| timechart span=5min dc(field1) by response
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;tried this one but when summaryindexed. it was unable to  recognise response field as it is eval field. all response count is under null.&lt;/P&gt;

&lt;P&gt;Normal output&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time                       200  401    403 404 409 422 500 504 NULL
1   4/8/13 9:40:00.000 AM   2151    2   9   87              9   108
2   4/8/13 9:45:00.000 AM   2746    10  17  333 4   2       41  862
3   4/8/13 9:50:00.000 AM   2770    11  17  359     2       49  827
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;output from summaryindex &lt;/P&gt;

&lt;P&gt;time  nulll&lt;BR /&gt;
somevalue   somevalue&lt;/P&gt;

&lt;P&gt;Please advise..&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2013 17:50:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-one-field-when-second-field-matches-string-200/m-p/87677#M22414</guid>
      <dc:creator>praveenvemuri</dc:creator>
      <dc:date>2013-04-08T17:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct count of one field when second field matches string %200%</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-one-field-when-second-field-matches-string-200/m-p/87678#M22415</link>
      <description>&lt;P&gt;Try this - put the values for response in quotes &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval response=case(rsppcode LIKE "%200%", "200",     rsppcode LIKE "%401%", "401", 
                   rsppcode LIKE "%403%", "403",     rsppcode LIKE "%404%", "404", 
                   rsppcode LIKE "%409%", "409",    rsppcode LIKE "%504%", "504", 
                   rsppcode LIKE "%500%", "500",     rsppcode LIKE "%422%", "422",
                   rsppcode LIKE "%550%", "550",    rsppcode LIKE "%", "Others" ) 
| timechart span=5min dc(field1) by response
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also recommend that you use &lt;CODE&gt;sitimechart&lt;/CODE&gt; instead of &lt;CODE&gt;timechart&lt;/CODE&gt; for summary indexing. Look &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/Knowledge/Usesummaryindexing#Use_the_summary_indexing_reporting_commands"&gt;here&lt;/A&gt; for more info&lt;/P&gt;

&lt;P&gt;Finally, I am not sure how the title of this post relates to the question - am I missing something?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2013 13:57:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinct-count-of-one-field-when-second-field-matches-string-200/m-p/87678#M22415</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-04-09T13:57:07Z</dc:date>
    </item>
  </channel>
</rss>

