<?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: Multiple devices in delta command? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiple-devices-in-delta-command/m-p/690094#M56540</link>
    <description>&lt;P&gt;Delta is a relatively simple command - just calculates difference from previous value. Nothing more, nothing less.&lt;/P&gt;&lt;P&gt;If you want to track the differences separately for - for example - different devices, you need to use streamstats to copy over previous value of a given field X separetely for each value of field Y (or a combination of more fields).&lt;/P&gt;&lt;PRE&gt;| streamstats current=f window=1 values(myfield) as old_myfield by splitfield&lt;/PRE&gt;&lt;P&gt;Now you can just calculate the difference of &lt;EM&gt;myfield&lt;/EM&gt; and &lt;EM&gt;old_myfield&lt;/EM&gt;.&lt;/P&gt;</description>
    <pubDate>Sat, 08 Jun 2024 20:15:56 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2024-06-08T20:15:56Z</dc:date>
    <item>
      <title>Multiple devices in delta command?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiple-devices-in-delta-command/m-p/690069#M56538</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I use the Delta command in splunk enterprise to record the power consumption of a device. This only gives me the difference in consumption. Now, however, I want to add 3 more devices to the same diagram, so the whole thing should be added up to a total consumption. Is this possible with Delta, and if so, how?&amp;nbsp;Which commands do I need for this?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Greetings&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2024 11:30:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiple-devices-in-delta-command/m-p/690069#M56538</guid>
      <dc:creator>alex8103</dc:creator>
      <dc:date>2024-06-08T11:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple devices in delta command?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiple-devices-in-delta-command/m-p/690088#M56539</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/268713"&gt;@alex8103&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;If your measurements are cumulative,&amp;nbsp; you can use either a simple stats range aggregation or a combination of streamstats and stats, assuming a valid epoch _time value:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| stats range(_time) as dt range(W) as dW by device
| eval kWh=(dW/1000)*(dt/3600)&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;| sort 0 _time
| streamstats current=f global=f window=2 last(_time) as pre_time last(W) as pre_W by device
| eval dt=_time-pre_time, dW=W-pre_W
| stats sum(dW) as dW sum(dt) as dt by device
| eval kWh=(dW/1000)*(dt/3600)&lt;/LI-CODE&gt;&lt;P&gt;If you want to chart differences between cumulative measurements over _time, you can use streamstats and timechart:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| sort 0 _time
| streamstats current=f global=f window=2 last(_time) as pre_time last(W) as pre_W by device
| eval dt=_time-pre_time, dW=W-pre_W
| timechart eval((sum(dW)/1000)*(sum(dt)/3600)) as kWh by device&lt;/LI-CODE&gt;&lt;P&gt;The timechart command snaps values to the nearest bin. If you need a more precise chart, use a span&amp;nbsp; argument corresponding to your time measurement precision.&lt;/P&gt;&lt;P&gt;(I don't work with power measurements. If I did the admittedly very basic math incorrectly, please correct it in a reply!)&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2024 16:10:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiple-devices-in-delta-command/m-p/690088#M56539</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2024-06-08T16:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple devices in delta command?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Multiple-devices-in-delta-command/m-p/690094#M56540</link>
      <description>&lt;P&gt;Delta is a relatively simple command - just calculates difference from previous value. Nothing more, nothing less.&lt;/P&gt;&lt;P&gt;If you want to track the differences separately for - for example - different devices, you need to use streamstats to copy over previous value of a given field X separetely for each value of field Y (or a combination of more fields).&lt;/P&gt;&lt;PRE&gt;| streamstats current=f window=1 values(myfield) as old_myfield by splitfield&lt;/PRE&gt;&lt;P&gt;Now you can just calculate the difference of &lt;EM&gt;myfield&lt;/EM&gt; and &lt;EM&gt;old_myfield&lt;/EM&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jun 2024 20:15:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Multiple-devices-in-delta-command/m-p/690094#M56540</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-06-08T20:15:56Z</dc:date>
    </item>
  </channel>
</rss>

