<?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: query help inner query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/query-help-inner-query/m-p/383888#M112122</link>
    <description>&lt;P&gt;Quite simple,&lt;BR /&gt;
Assuming &lt;CODE&gt;|inputlookup preview_infra.csv | search InfraName="FRA-CLOUD GTS" | fields HostName&lt;/CODE&gt; gives you the host, just add this as host within the search like below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | mstats max(_value) as Bits_in_sec where index=ehealth  [|inputlookup preview_infra.csv | search InfraName="FRA-CLOUD GTS" | fields HostName| rename HostName as host]  metric_name="*in" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Just to add , your query is too complex. You can make it much simpler imo&lt;/P&gt;</description>
    <pubDate>Tue, 21 May 2019 15:23:47 GMT</pubDate>
    <dc:creator>koshyk</dc:creator>
    <dc:date>2019-05-21T15:23:47Z</dc:date>
    <item>
      <title>query help inner query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-help-inner-query/m-p/383887#M112121</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| mstats max(_value) as Bits_in_sec where index=ehealth (host="SC2CLK-CLOUD-CFD-VDC2" OR host="SC2BJV-CLOUD-CFD-VDC2" OR host="DC2A4-CLOUD-CFD-VDC2") AND metric_name="*in"   
    by host,metric_name, info span=1d | rex field="metric_name" "(?P&amp;lt;Interface&amp;gt;.*)\_(?P&amp;lt;InOut&amp;gt;[^\_]+)$" |  eval BandW=trim('info',"Bandwidth:")
| eval "BW_in"=round(Bits_in_sec/300/BandW*100,5) | appendcols [| mstats max(_value) as Bits_out_sec where index=ehealth (host="SC2CLK-CLOUD-CFD-VDC2" OR host="SC2BJV-CLOUD-CFD-VDC2" OR host="DC2A4-CLOUD-CFD-VDC2") AND metric_name="*out"
    by host,metric_name, info span=1d | rex field="metric_name" "(?P&amp;lt;Interface&amp;gt;.*)\_(?P&amp;lt;InOut&amp;gt;[^\_]+)$" |  eval BandW=trim('info',"Bandwidth:")
| eval "BW_out"=round(Bits_out_sec/300/BandW*100,5)] |rename BandW as BandWidth| table _time host Interface BandWidth Bits_in_sec BW_in BW_out Bits_out_sec | rename BW_in as "BW_in%" BW_out as "BW_out%" | sort - "BW_out%" |head 20
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In my above query i want to replace (host="SC2CLK-CLOUD-CFD-VDC2" OR host="SC2BJV-CLOUD-CFD-VDC2" OR host="DC2A4-CLOUD-CFD-VDC2") with value from a csv file. &lt;BR /&gt;
I have a mapping file where i have a HostName column&lt;BR /&gt;
|inputlookup preview_infra.csv | search InfraName="FRA-CLOUD GTS" | fields HostName&lt;BR /&gt;
I get below output for above query. &lt;BR /&gt;
host="SC2CLK-CLOUD-CFD-VDC2" OR host="SC2BJV-CLOUD-CFD-VDC2" OR host="DC2A4-CLOUD-CFD-VDC2"&lt;/P&gt;

&lt;P&gt;Now how to add this query to above query . Please help. urgent. &lt;/P&gt;

&lt;P&gt;in place hos that host =bla bla i want to replace host=$HostName$ &lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 14:36:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-help-inner-query/m-p/383887#M112121</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2019-05-21T14:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: query help inner query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-help-inner-query/m-p/383888#M112122</link>
      <description>&lt;P&gt;Quite simple,&lt;BR /&gt;
Assuming &lt;CODE&gt;|inputlookup preview_infra.csv | search InfraName="FRA-CLOUD GTS" | fields HostName&lt;/CODE&gt; gives you the host, just add this as host within the search like below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | mstats max(_value) as Bits_in_sec where index=ehealth  [|inputlookup preview_infra.csv | search InfraName="FRA-CLOUD GTS" | fields HostName| rename HostName as host]  metric_name="*in" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Just to add , your query is too complex. You can make it much simpler imo&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 15:23:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-help-inner-query/m-p/383888#M112122</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-21T15:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: query help inner query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-help-inner-query/m-p/383889#M112123</link>
      <description>&lt;P&gt;hi @koshyk,&lt;/P&gt;

&lt;P&gt;Thanks for the reply but am not getting the desired result if i explicitly give host=A then only am getting the result. &lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 01:09:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-help-inner-query/m-p/383889#M112123</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2019-05-22T01:09:32Z</dc:date>
    </item>
  </channel>
</rss>

