<?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 Calculating math on three different searches in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Calculating-math-on-three-different-searches/m-p/670256#M112392</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to write a query to find the time remaining to consume events.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=x message.message="Response sent" message.feedId="v1" | stats count as Produced&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;index=y | spath RenderedMessage | search RenderedMessage="*/v1/xyz*StatusCode*2*"| stats count as Processed&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;index=z message.feedId="v1" | stats avg("message.durationMs") as AverageResponseTime&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I want to basically perform:&lt;BR /&gt;Average Time left = Produced - Processed /AverageResponseTime&lt;/P&gt;&lt;P&gt;How can I go about doing this?&lt;/P&gt;&lt;P&gt;Thank you so much&lt;/P&gt;</description>
    <pubDate>Thu, 30 Nov 2023 06:38:19 GMT</pubDate>
    <dc:creator>labaningombam</dc:creator>
    <dc:date>2023-11-30T06:38:19Z</dc:date>
    <item>
      <title>Calculating math on three different searches</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Calculating-math-on-three-different-searches/m-p/670256#M112392</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to write a query to find the time remaining to consume events.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=x message.message="Response sent" message.feedId="v1" | stats count as Produced&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;index=y | spath RenderedMessage | search RenderedMessage="*/v1/xyz*StatusCode*2*"| stats count as Processed&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;index=z message.feedId="v1" | stats avg("message.durationMs") as AverageResponseTime&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I want to basically perform:&lt;BR /&gt;Average Time left = Produced - Processed /AverageResponseTime&lt;/P&gt;&lt;P&gt;How can I go about doing this?&lt;/P&gt;&lt;P&gt;Thank you so much&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 06:38:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Calculating-math-on-three-different-searches/m-p/670256#M112392</guid>
      <dc:creator>labaningombam</dc:creator>
      <dc:date>2023-11-30T06:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating math on three different searches</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Calculating-math-on-three-different-searches/m-p/670272#M112393</link>
      <description>&lt;P&gt;You could try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=x message.message="Response sent" message.feedId="v1" | stats count as Produced
| appendcols [ search index=y | spath RenderedMessage | search RenderedMessage="*/v1/xyz*StatusCode*2*"| stats count as Processed]
| appendcols [ search index=z message.feedId="v1" | stats avg("message.durationMs") as AverageResponseTime]
| eval AverageTimeLeft = (Produced - Processed) * AverageResponseTime&lt;/LI-CODE&gt;&lt;P&gt;Note that I think your calculation should be a multiplication not a division&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 09:24:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Calculating-math-on-three-different-searches/m-p/670272#M112393</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-11-30T09:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating math on three different searches</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Calculating-math-on-three-different-searches/m-p/670278#M112394</link>
      <description>&lt;P&gt;Thank you so much for the correction as well &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This worked.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 09:45:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Calculating-math-on-three-different-searches/m-p/670278#M112394</guid>
      <dc:creator>labaningombam</dc:creator>
      <dc:date>2023-11-30T09:45:41Z</dc:date>
    </item>
  </channel>
</rss>

