<?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: Graphing Weighted Values in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Graphing-Weighted-Values/m-p/97497#M44232</link>
    <description>&lt;P&gt;gkanapathy,&lt;/P&gt;

&lt;P&gt;thanks for your comment, it was enough to push me in the right direction.... this is what worked.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=DLOG "new connection" |stats count as connections,dc(device_id) as num_devices by client_id| eval ratio = connections/num_devices|stats avg(ratio) AS Connection_Ratio by client_id|sort -Connection_Ratio limit=10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;thanks very much!&lt;/P&gt;</description>
    <pubDate>Tue, 25 Oct 2011 18:55:08 GMT</pubDate>
    <dc:creator>nickhills</dc:creator>
    <dc:date>2011-10-25T18:55:08Z</dc:date>
    <item>
      <title>Graphing Weighted Values</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Graphing-Weighted-Values/m-p/97494#M44229</link>
      <description>&lt;P&gt;we have log files which record incoming connections from our clients and the device_id.&lt;BR /&gt;
we would like to graph a representative number of incoming connections weighted by the number of devices they have. The idea being that if a customer has an unusually high number of connections for the devices they have, it would indicate an issue.&lt;/P&gt;

&lt;P&gt;our log files look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2011-10-25 12:06:44.829 : DLG : INFO   : DeviceConnection [device_id:088243] [client:abc.com] new connection event with client id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i have field extractions for device_id and client_id, but cant work our how to graph this.&lt;/P&gt;

&lt;P&gt;what i want is number of connectons for client_id / number of device_ids (where number of devices come from occurrences in the logs across the same time period)&lt;/P&gt;

&lt;P&gt;i think i need an eval statement, but cant quite figure out the syntax. Can anyone help, or point me in the right direction.&lt;/P&gt;

&lt;P&gt;thanks very much.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:01:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Graphing-Weighted-Values/m-p/97494#M44229</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2020-09-28T10:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Weighted Values</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Graphing-Weighted-Values/m-p/97495#M44230</link>
      <description>&lt;P&gt;I have now got as far as the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; sourcetype=DLOG "new connection" client_id=536352|eventstats dc(device_conn_id) AS numdev|eventstats count(device_conn_id) AS countdev|eval ratio=(countdev/numdev)|stats min(countdev) by client_id,numdev,ratio
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this gives me a ratio field, which is number of events / number of devices.&lt;/P&gt;

&lt;P&gt;but i want to run this against all client ids, but when i remove the client id from the search, it returns totals (across all accounts), and thus 1 identical ratio and number of events for all clients.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2011 15:01:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Graphing-Weighted-Values/m-p/97495#M44230</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2011-10-25T15:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Weighted Values</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Graphing-Weighted-Values/m-p/97496#M44231</link>
      <description>&lt;P&gt;I don't really understand what you're asking or why you're taking &lt;CODE&gt;min(countdev)&lt;/CODE&gt;, but seems to me that&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ssourcetype=DLOG "new connection" 
| stats count as connections, dc(device_id) as num_devices by client_id
| eval ratio = connections/num_devices
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;gives you the connections for each client, and the number of devices for each client, and divides them. You can add a &lt;CODE&gt;| sort - ratio&lt;/CODE&gt; to see the most suspicious ones.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2011 18:08:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Graphing-Weighted-Values/m-p/97496#M44231</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-10-25T18:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Weighted Values</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Graphing-Weighted-Values/m-p/97497#M44232</link>
      <description>&lt;P&gt;gkanapathy,&lt;/P&gt;

&lt;P&gt;thanks for your comment, it was enough to push me in the right direction.... this is what worked.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=DLOG "new connection" |stats count as connections,dc(device_id) as num_devices by client_id| eval ratio = connections/num_devices|stats avg(ratio) AS Connection_Ratio by client_id|sort -Connection_Ratio limit=10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;thanks very much!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2011 18:55:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Graphing-Weighted-Values/m-p/97497#M44232</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2011-10-25T18:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Graphing Weighted Values</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Graphing-Weighted-Values/m-p/97498#M44233</link>
      <description>&lt;P&gt;Your second &lt;CODE&gt;stats&lt;/CODE&gt; command does not do anything at all other than remove and rename some fields, and you can do this much more clearly and efficiently with the &lt;CODE&gt;fields&lt;/CODE&gt; command, and by selecting the right field names in the first place (in the eval).&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2011 19:01:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Graphing-Weighted-Values/m-p/97498#M44233</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-10-25T19:01:57Z</dc:date>
    </item>
  </channel>
</rss>

