<?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: using a result from one query in the calculation of another in Other Usage</title>
    <link>https://community.splunk.com/t5/Other-Usage/How-to-use-a-result-from-one-query-in-the-calculation-of-another/m-p/632102#M8</link>
    <description>&lt;P&gt;Thanks for the reply. I do prefer your appendcols to the join I was using, but I was more after saving the value of activeStorageLicenseGB as something I can use in calculations rather than populating a new column. I'm new to Splunk though, so I may well be thinking about this all wrong.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Feb 2023 23:45:15 GMT</pubDate>
    <dc:creator>cactus</dc:creator>
    <dc:date>2023-02-23T23:45:15Z</dc:date>
    <item>
      <title>How to use a result from one query in the calculation of another?</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-use-a-result-from-one-query-in-the-calculation-of-another/m-p/631951#M6</link>
      <description>&lt;P&gt;I've got the following to calculate our quota:&lt;BR /&gt;&lt;BR /&gt;index=summary source="splunk-storage-summary"| stats latest(activeStorageLicenseGB)&lt;/P&gt;
&lt;P&gt;and the following to give a list of how much is in each of our indexes:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=summary source="splunk-storage-detail"
|stats
latest(rawSizeGBCustomer) as "size"
by idxName
|sort -size
|fields idxName size&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I'd like to do is display 'size' in the second query as a percentage of our quota using the results of the first query. I can do it if I use a join and then eval, but is there a way to store the results of that first query in a variable I can then use in the second query?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 04:46:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-use-a-result-from-one-query-in-the-calculation-of-another/m-p/631951#M6</guid>
      <dc:creator>cactus</dc:creator>
      <dc:date>2023-02-24T04:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: using a result from one query in the calculation of another</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-use-a-result-from-one-query-in-the-calculation-of-another/m-p/631998#M7</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=summary source="splunk-storage-detail"
|stats
latest(rawSizeGBCustomer) as "size"
by idxName
|sort -size
|fields idxName size
| appendcols
  [search index=summary source="splunk-storage-summary"| stats latest(activeStorageLicenseGB) as activeStorageLicenseGB]
| eventstats values(activeStorageLicenseGB) as activeStorageLicenseGB&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 23 Feb 2023 11:10:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-use-a-result-from-one-query-in-the-calculation-of-another/m-p/631998#M7</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-02-23T11:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: using a result from one query in the calculation of another</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-use-a-result-from-one-query-in-the-calculation-of-another/m-p/632102#M8</link>
      <description>&lt;P&gt;Thanks for the reply. I do prefer your appendcols to the join I was using, but I was more after saving the value of activeStorageLicenseGB as something I can use in calculations rather than populating a new column. I'm new to Splunk though, so I may well be thinking about this all wrong.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 23:45:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-use-a-result-from-one-query-in-the-calculation-of-another/m-p/632102#M8</guid>
      <dc:creator>cactus</dc:creator>
      <dc:date>2023-02-23T23:45:15Z</dc:date>
    </item>
  </channel>
</rss>

