<?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 Refining the search query using dynamic values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Refining-the-search-query-using-dynamic-values/m-p/620092#M215543</link>
    <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a search query where I am trying to get values for the search from the results of another query.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal
[ `set_local_host`] source=*license_usage.log* type="Usage"
| eval h=if(len(h)=0 OR isnull(h),"(SQUASHED)",h)
| eval s=if(len(s)=0 OR isnull(s),"(SQUASHED)",s)
| eval idx=if(len(idx)=0 OR isnull(idx),"(UNKNOWN)",idx)
| bin _time span=1d
| stats sum(b) as b by _time, pool, s, st, h, idx
| search pool = "*"
| search h = hp742srv OR dell970srv OR dell428srv OR hp548srv OR dell429srv OR dell477srv OR dell433srv
| timechart span=1d sum(b) AS volumeB by idx fixedrange=false limit=30
| join type=outer _time
[ search index=_internal
[ `set_local_host`] source=*license_usage.log* type="RolloverSummary" earliest=-30d@d
| eval _time=_time - 43200
| bin _time span=1d
| stats latest(stacksz) AS "stack size" by _time]
| fields - _timediff
| foreach *
[ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=round('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'/1024/1024/1024, 3)]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The search statement in line number 9 has a list of host names which I have entered manually using the OR operator. The below query can generate the list of results but I am not able to use the result in the above query.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=mx_logs "mx.env"="dell1192srv.fr.mx.com:15022" 
|  table host 
|  dedup host&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;How can I use the results from the 2nd query dynamically in the first SPL query?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pravin&lt;/P&gt;</description>
    <pubDate>Tue, 08 Nov 2022 12:02:50 GMT</pubDate>
    <dc:creator>_pravin</dc:creator>
    <dc:date>2022-11-08T12:02:50Z</dc:date>
    <item>
      <title>Refining the search query using dynamic values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Refining-the-search-query-using-dynamic-values/m-p/620092#M215543</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a search query where I am trying to get values for the search from the results of another query.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal
[ `set_local_host`] source=*license_usage.log* type="Usage"
| eval h=if(len(h)=0 OR isnull(h),"(SQUASHED)",h)
| eval s=if(len(s)=0 OR isnull(s),"(SQUASHED)",s)
| eval idx=if(len(idx)=0 OR isnull(idx),"(UNKNOWN)",idx)
| bin _time span=1d
| stats sum(b) as b by _time, pool, s, st, h, idx
| search pool = "*"
| search h = hp742srv OR dell970srv OR dell428srv OR hp548srv OR dell429srv OR dell477srv OR dell433srv
| timechart span=1d sum(b) AS volumeB by idx fixedrange=false limit=30
| join type=outer _time
[ search index=_internal
[ `set_local_host`] source=*license_usage.log* type="RolloverSummary" earliest=-30d@d
| eval _time=_time - 43200
| bin _time span=1d
| stats latest(stacksz) AS "stack size" by _time]
| fields - _timediff
| foreach *
[ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=round('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'/1024/1024/1024, 3)]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The search statement in line number 9 has a list of host names which I have entered manually using the OR operator. The below query can generate the list of results but I am not able to use the result in the above query.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=mx_logs "mx.env"="dell1192srv.fr.mx.com:15022" 
|  table host 
|  dedup host&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;How can I use the results from the 2nd query dynamically in the first SPL query?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pravin&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 12:02:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Refining-the-search-query-using-dynamic-values/m-p/620092#M215543</guid>
      <dc:creator>_pravin</dc:creator>
      <dc:date>2022-11-08T12:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Refining the search query using dynamic values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Refining-the-search-query-using-dynamic-values/m-p/620097#M215546</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal
[ `set_local_host`] source=*license_usage.log* type="Usage"
| eval h=if(len(h)=0 OR isnull(h),"(SQUASHED)",h)
| eval s=if(len(s)=0 OR isnull(s),"(SQUASHED)",s)
| eval idx=if(len(idx)=0 OR isnull(idx),"(UNKNOWN)",idx)
| bin _time span=1d
| stats sum(b) as b by _time, pool, s, st, h, idx
| search pool = "*"
| search [search index=mx_logs "mx.env"="dell1192srv.fr.mx.com:15022" 
|  table host 
|  dedup host
| rename host as h
| format]
| timechart span=1d sum(b) AS volumeB by idx fixedrange=false limit=30
| join type=outer _time
[ search index=_internal
[ `set_local_host`] source=*license_usage.log* type="RolloverSummary" earliest=-30d@d
| eval _time=_time - 43200
| bin _time span=1d
| stats latest(stacksz) AS "stack size" by _time]
| fields - _timediff
| foreach *
[ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=round('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'/1024/1024/1024, 3)]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 15:48:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Refining-the-search-query-using-dynamic-values/m-p/620097#M215546</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-11-08T15:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Refining the search query using dynamic values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Refining-the-search-query-using-dynamic-values/m-p/620145#M215573</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 15:46:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Refining-the-search-query-using-dynamic-values/m-p/620145#M215573</guid>
      <dc:creator>_pravin</dc:creator>
      <dc:date>2022-11-08T15:46:39Z</dc:date>
    </item>
  </channel>
</rss>

