<?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 Subsearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Subsearch/m-p/551094#M156375</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've been trying for hours and nothing works, so I figure you might help me out.&lt;/P&gt;&lt;P&gt;I have the following very long&amp;nbsp;query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;| tstats SUM(requested_cpus) as requested_cpus, SUM(reserved_ram) as reserved_ram, SUM(requested_ram) as requested_ram, SUM(used_ram) as used_ram, SUM(compute_ram_total) as compute_ram_total, count as agg_field_seen WHERE (index=monitor (host="$queuename$") fs_group=$fsgroup$ project=$project$ site=$site$            (slave_resource{} IN ("*")) (NOT slave_resource{} IN ("___VALUE_NONE___"))     ( host_state="normal" OR host_state="full" OR host_state="ovrld" OR host_state="sick" OR host_state="susp" OR  host_state="base" OR host_state="ready")     )
          OR (index=ncstat_monitor (host="$queuename$") fs_group=$fsgroup$ project=$project$ site=$site$ (compute_slave_res{} IN ("*")) (NOT compute_slave_res{} IN ("___VALUE_NONE___"))     ( host_state="normal" OR host_state="full" OR host_state="ovrld" OR host_state="sick" OR host_state="susp" OR  host_state="base" OR host_state="ready") ) BY _time, site, fs_group span=15min | eval query_enabled=1
                | eventstats sum(agg_field_seen) AS sum_agg_field_seen BY fs_group
                | sort 0 - sum_agg_field_seen
                | streamstats dc(fs_group) AS rank
                | eval agg_field_ranked=if(rank &amp;lt;= 50 - 1, 'fs_group', "Other")
                | rename agg_field_ranked as fs_group
          | stats SUM(reserved_ram) as reserved_ram, SUM(requested_ram) as requested_ram, SUM(used_ram) as used_ram, SUM(compute_ram_total) as compute_ram_total, SUM(requested_cpus) as requested_cpus BY _time, site, fs_group
| eval slots=max(reserved_ram/32,requested_cpus) | eval full_fsgroup=site.":".fs_group 
          | timechart span=15min limit=50 partial=false MAX(slots) as Slots BY full_fsgroup&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition, I have another query from different index:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;`p_flow("*",dv)` "***" reg_name=*$reg$* event_type=flow | eval fairshare = coalesce(fairshare, fsgroup) | table  fairshare | dedup  fairshare&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The issue is, I would like to limit the results to match only the output of the fairshare field from the second query.&lt;/P&gt;&lt;P&gt;Please notice that fairshare in the first query called fs_group&lt;/P&gt;&lt;P&gt;I've been trying many options from different past answers and nothing seem to be working. Please assist and be blessed forever.&lt;/P&gt;</description>
    <pubDate>Mon, 10 May 2021 13:18:07 GMT</pubDate>
    <dc:creator>yifatcy</dc:creator>
    <dc:date>2021-05-10T13:18:07Z</dc:date>
    <item>
      <title>Subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch/m-p/551094#M156375</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've been trying for hours and nothing works, so I figure you might help me out.&lt;/P&gt;&lt;P&gt;I have the following very long&amp;nbsp;query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;| tstats SUM(requested_cpus) as requested_cpus, SUM(reserved_ram) as reserved_ram, SUM(requested_ram) as requested_ram, SUM(used_ram) as used_ram, SUM(compute_ram_total) as compute_ram_total, count as agg_field_seen WHERE (index=monitor (host="$queuename$") fs_group=$fsgroup$ project=$project$ site=$site$            (slave_resource{} IN ("*")) (NOT slave_resource{} IN ("___VALUE_NONE___"))     ( host_state="normal" OR host_state="full" OR host_state="ovrld" OR host_state="sick" OR host_state="susp" OR  host_state="base" OR host_state="ready")     )
          OR (index=ncstat_monitor (host="$queuename$") fs_group=$fsgroup$ project=$project$ site=$site$ (compute_slave_res{} IN ("*")) (NOT compute_slave_res{} IN ("___VALUE_NONE___"))     ( host_state="normal" OR host_state="full" OR host_state="ovrld" OR host_state="sick" OR host_state="susp" OR  host_state="base" OR host_state="ready") ) BY _time, site, fs_group span=15min | eval query_enabled=1
                | eventstats sum(agg_field_seen) AS sum_agg_field_seen BY fs_group
                | sort 0 - sum_agg_field_seen
                | streamstats dc(fs_group) AS rank
                | eval agg_field_ranked=if(rank &amp;lt;= 50 - 1, 'fs_group', "Other")
                | rename agg_field_ranked as fs_group
          | stats SUM(reserved_ram) as reserved_ram, SUM(requested_ram) as requested_ram, SUM(used_ram) as used_ram, SUM(compute_ram_total) as compute_ram_total, SUM(requested_cpus) as requested_cpus BY _time, site, fs_group
| eval slots=max(reserved_ram/32,requested_cpus) | eval full_fsgroup=site.":".fs_group 
          | timechart span=15min limit=50 partial=false MAX(slots) as Slots BY full_fsgroup&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition, I have another query from different index:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;`p_flow("*",dv)` "***" reg_name=*$reg$* event_type=flow | eval fairshare = coalesce(fairshare, fsgroup) | table  fairshare | dedup  fairshare&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The issue is, I would like to limit the results to match only the output of the fairshare field from the second query.&lt;/P&gt;&lt;P&gt;Please notice that fairshare in the first query called fs_group&lt;/P&gt;&lt;P&gt;I've been trying many options from different past answers and nothing seem to be working. Please assist and be blessed forever.&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 13:18:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch/m-p/551094#M156375</guid>
      <dc:creator>yifatcy</dc:creator>
      <dc:date>2021-05-10T13:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch/m-p/551096#M156376</link>
      <description>&lt;P&gt;At the risk of suggesting something you've already tried, have you tried this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats SUM(requested_cpus) as requested_cpus, SUM(reserved_ram) as reserved_ram, SUM(requested_ram) as requested_ram, SUM(used_ram) as used_ram, SUM(compute_ram_total) as compute_ram_total, count as agg_field_seen WHERE (index=ncstat_monitor (host="$queuename$") [`p_flow("*",dv)` "***" regression_name=*$regression$* event_type=flow | eval fs_group = coalesce(fairshare, fsgroup) | fields fs_group | dedup  fs_group | format ] project=$project$ site=$site$            (slave_resource{} IN ("*")) (NOT slave_resource{} IN ("___VALUE_NONE___"))     ( host_state="normal" OR host_state="full" OR host_state="ovrld" OR host_state="sick" OR host_state="susp" OR  host_state="base" OR host_state="ready")     )
          OR (index=ncstat_monitor (host="$queuename$") fs_group=$fsgroup$ project=$project$ site=$site$ (compute_slave_res{} IN ("*")) (NOT compute_slave_res{} IN ("___VALUE_NONE___"))     ( host_state="normal" OR host_state="full" OR host_state="ovrld" OR host_state="sick" OR host_state="susp" OR  host_state="base" OR host_state="ready") ) BY _time, site, fs_group span=15min | eval query_enabled=1
...&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 10 May 2021 12:57:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch/m-p/551096#M156376</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-05-10T12:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Subsearch/m-p/551098#M156377</link>
      <description>&lt;P&gt;Perfect, the "format" at the end did the job.&lt;/P&gt;&lt;P&gt;Just added [&lt;STRONG&gt;search&lt;/STRONG&gt; `p_flow......... ] and it worked!&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 13:15:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Subsearch/m-p/551098#M156377</guid>
      <dc:creator>yifatcy</dc:creator>
      <dc:date>2021-05-10T13:15:34Z</dc:date>
    </item>
  </channel>
</rss>

