<?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 Rest search  with input from inputlook in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rest-search-with-input-from-inputlook/m-p/541225#M153228</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm bouncing my head against the wall for this (probably) simple question..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got a inputlookup "indexers". As the name says.. those are the splunk indexers, but will be more than that in the future. I want to get disc sizes off them with the below serach&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;|inputlookup indexers | fields host | stats count by host |map search="search (| rest splunk_server=$host$ /services/server/status/partitions-space]")&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It all goes well until the map command. The stats gives a nice list off the servers. It goes wrong at the "&lt;STRONG&gt;search (| rest splunk_server=$host$ /services/server/status/partitions-space]&lt;/STRONG&gt;"&amp;nbsp; &amp;nbsp;part.&lt;/P&gt;&lt;P&gt;When i try this part off the search.. it strips the | from the search.. and gives nothing. It seems a search command followed with a | will strip the | .. and then de rest search is useless.&lt;/P&gt;&lt;P&gt;What can i do to pass the hostnames from the inputlookup to the &lt;EM&gt;|rest&lt;/EM&gt; search?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanx in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;grts&lt;/P&gt;&lt;P&gt;Jari&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Feb 2021 14:30:28 GMT</pubDate>
    <dc:creator>jariw</dc:creator>
    <dc:date>2021-02-24T14:30:28Z</dc:date>
    <item>
      <title>Rest search  with input from inputlook</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-search-with-input-from-inputlook/m-p/541225#M153228</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm bouncing my head against the wall for this (probably) simple question..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got a inputlookup "indexers". As the name says.. those are the splunk indexers, but will be more than that in the future. I want to get disc sizes off them with the below serach&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;|inputlookup indexers | fields host | stats count by host |map search="search (| rest splunk_server=$host$ /services/server/status/partitions-space]")&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It all goes well until the map command. The stats gives a nice list off the servers. It goes wrong at the "&lt;STRONG&gt;search (| rest splunk_server=$host$ /services/server/status/partitions-space]&lt;/STRONG&gt;"&amp;nbsp; &amp;nbsp;part.&lt;/P&gt;&lt;P&gt;When i try this part off the search.. it strips the | from the search.. and gives nothing. It seems a search command followed with a | will strip the | .. and then de rest search is useless.&lt;/P&gt;&lt;P&gt;What can i do to pass the hostnames from the inputlookup to the &lt;EM&gt;|rest&lt;/EM&gt; search?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanx in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;grts&lt;/P&gt;&lt;P&gt;Jari&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 14:30:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-search-with-input-from-inputlook/m-p/541225#M153228</guid>
      <dc:creator>jariw</dc:creator>
      <dc:date>2021-02-24T14:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Rest search  with input from inputlook</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-search-with-input-from-inputlook/m-p/541230#M153230</link>
      <description>&lt;P&gt;Hi Jari,&lt;BR /&gt;&lt;BR /&gt;You don't need to run sub-search for each host. Run&amp;nbsp;&lt;STRONG&gt;rest &lt;/STRONG&gt;command first, append &lt;STRONG&gt;lookup&lt;/STRONG&gt; results, and use &lt;STRONG&gt;stats&lt;/STRONG&gt; to merge.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rest /services/server/status/partitions-space 
| append 
    [| inputlookup indexers 
    | fields host 
    | stats count by host 
    | eval splunk_server=host] 
| stats max(*) as * by splunk_server 
| where host="*"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;| where host="*"&lt;/STRONG&gt; gives results only for hosts in the lookup file.&lt;BR /&gt;&lt;BR /&gt;If this reply helps you, an upvote/like would be appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 14:55:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-search-with-input-from-inputlook/m-p/541230#M153230</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-02-24T14:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Rest search  with input from inputlook</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-search-with-input-from-inputlook/m-p/541234#M153233</link>
      <description>&lt;P&gt;Yes.. That's it. Didn't think about changing the order. Thanx again&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 15:24:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-search-with-input-from-inputlook/m-p/541234#M153233</guid>
      <dc:creator>jariw</dc:creator>
      <dc:date>2021-02-24T15:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: Rest search  with input from inputlook</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rest-search-with-input-from-inputlook/m-p/541235#M153234</link>
      <description>&lt;P&gt;please accept and upvote answer if it is working.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 15:37:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rest-search-with-input-from-inputlook/m-p/541235#M153234</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-02-24T15:37:45Z</dc:date>
    </item>
  </channel>
</rss>

