<?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: How to create a timechart that includes the count of distinct IP addresses with the count and average of transactions by request type? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-timechart-that-includes-the-count-of-distinct-IP/m-p/200138#M57986</link>
    <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your base search with fields _time ip_address request_type response_time 
| bucket span=1h _time 
| stats count sum(response_time) as response_time by _time  ip_address request_type 
| stats dc(ip_address) as uniq_ips sum(count) as transaction_count sum(response_time) as response_time) by _time request_type 
| eval avg_response_time=round(response_time/transaction_count,2) | fields - response_time 
| chart values(uniq_ips) values(avg_response_time) values(transaction_count) over _time by request_type
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 10 Feb 2016 19:18:40 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-02-10T19:18:40Z</dc:date>
    <item>
      <title>How to create a timechart that includes the count of distinct IP addresses with the count and average of transactions by request type?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-timechart-that-includes-the-count-of-distinct-IP/m-p/200137#M57985</link>
      <description>&lt;P&gt;I want to create a timechart which has results:&lt;BR /&gt;
 - count of distinct IP addresses&lt;BR /&gt;
 - average of transaction response time, by request type&lt;BR /&gt;
 - count of transactions, by request type&lt;/P&gt;

&lt;P&gt;Each request has an IP address, a type, and a transaction response time.&lt;/P&gt;

&lt;P&gt;I can't find a way to create or add the count of distinct IP addresses without doing a second pass through the logs, which is inefficient as we have ~750,000 txns per hour.&lt;/P&gt;

&lt;P&gt;I've tried many different combinations of bin, stats, chart, &amp;amp; timechart, and I got close (a column for each transaction_type of distinct_ip_addresses, count of transactions, sum of response_time), but then couldn't find a way to create the max(distinct_ip_addresses) across the 8 fields (columns) created.&lt;/P&gt;

&lt;P&gt;Any advice (or a better way)?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:47:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-timechart-that-includes-the-count-of-distinct-IP/m-p/200137#M57985</guid>
      <dc:creator>JeToJedno</dc:creator>
      <dc:date>2020-09-29T08:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a timechart that includes the count of distinct IP addresses with the count and average of transactions by request type?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-timechart-that-includes-the-count-of-distinct-IP/m-p/200138#M57986</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your base search with fields _time ip_address request_type response_time 
| bucket span=1h _time 
| stats count sum(response_time) as response_time by _time  ip_address request_type 
| stats dc(ip_address) as uniq_ips sum(count) as transaction_count sum(response_time) as response_time) by _time request_type 
| eval avg_response_time=round(response_time/transaction_count,2) | fields - response_time 
| chart values(uniq_ips) values(avg_response_time) values(transaction_count) over _time by request_type
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Feb 2016 19:18:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-timechart-that-includes-the-count-of-distinct-IP/m-p/200138#M57986</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-10T19:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a timechart that includes the count of distinct IP addresses with the count and average of transactions by request type?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-timechart-that-includes-the-count-of-distinct-IP/m-p/200139#M57987</link>
      <description>&lt;P&gt;Many thanks.  That's very close.  I added "AS" clauses to the values(), but  I'm missing a final step - how do I combine the multiple uniq_ips into a single one (using max)?&lt;BR /&gt;
All the methods I've tried don't work with globing, e.g. eval max(uniq_ip:*), and I don;t want to detail each transaction type as I'd then need to keep track of what the architects and development teams are doing and update the analysis each time they add a new transaction type ...&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:43:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-timechart-that-includes-the-count-of-distinct-IP/m-p/200139#M57987</guid>
      <dc:creator>JeToJedno</dc:creator>
      <dc:date>2020-09-29T08:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a timechart that includes the count of distinct IP addresses with the count and average of transactions by request type?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-timechart-that-includes-the-count-of-distinct-IP/m-p/200140#M57988</link>
      <description>&lt;P&gt;I added the following, in place of the chart line:&lt;BR /&gt;
  | eventstats allnum=false max(uniq_ips) as max_uniq_ips by _time | fields - uniq_ips&lt;/P&gt;

&lt;P&gt;Now I just need to form an appropriate chart line to create a single value ...&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:43:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-timechart-that-includes-the-count-of-distinct-IP/m-p/200140#M57988</guid>
      <dc:creator>JeToJedno</dc:creator>
      <dc:date>2020-09-29T08:43:56Z</dc:date>
    </item>
  </channel>
</rss>

