<?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: How to loop through results of a main inputlookup and combine with a child inputlookup? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-loop-through-results-of-a-main-inputlookup-and-combine/m-p/273530#M82472</link>
    <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup wlaa_hosts.csv | eval Host=split(HostList,",") | stats count by Host | join max=50 [| inputlookup secondlookup.csv | table MetricID AlertMsg ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 26 Oct 2016 16:21:46 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-10-26T16:21:46Z</dc:date>
    <item>
      <title>How to loop through results of a main inputlookup and combine with a child inputlookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-loop-through-results-of-a-main-inputlookup-and-combine/m-p/273528#M82470</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;

&lt;P&gt;i have a main search-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup wlaa_hosts.csv | eval Host=split(HostList,",") | stats count by Host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;that results with-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Host           count
host1            1
host2            1
host3            1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i have another lookup that looks like-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;MetricID                  AlertMsg
response_time             resp time &amp;gt; 10
error_count               error &amp;gt; 20
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i want to loop through each of the host and attach it to every row in the child lookup, so that the result looks like-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Host     MetricID             AlertMsg
host1    response_time        resp time &amp;gt; 10
host1    error_count          error &amp;gt; 20
host2    response_time        resp time &amp;gt; 10
host2    error_count          error &amp;gt; 20
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;final step is to output each row to a KV Store lookup&lt;/P&gt;

&lt;P&gt;i tried using the &lt;CODE&gt;map&lt;/CODE&gt; command but it did not give me the desired result.   appreciate very much for any help.  thnx&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 15:26:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-loop-through-results-of-a-main-inputlookup-and-combine/m-p/273528#M82470</guid>
      <dc:creator>erwin_pader_1dc</dc:creator>
      <dc:date>2016-10-26T15:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop through results of a main inputlookup and combine with a child inputlookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-loop-through-results-of-a-main-inputlookup-and-combine/m-p/273529#M82471</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup wlaa_hosts.csv | eval Host=split(HostList,",") | stats count by Host | inputlookup append=t secondfile.csv | fillnull Host value="settings" | eventstats values(if(eval(host="settings", MetricID, null()))) as MetricID values(if(eval(host="settings", AlertMsg, null()))) as AlertMsg by host | where Host!="settings" | eval z=mvzip(MetricID, AlertMsg, "#") | mvexpand z | rex field=z "(?&amp;lt;MetricID&amp;gt;[^#]+)#(?&amp;lt;AlertMsg&amp;gt;.+)" | fields - z
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Oct 2016 16:21:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-loop-through-results-of-a-main-inputlookup-and-combine/m-p/273529#M82471</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-26T16:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop through results of a main inputlookup and combine with a child inputlookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-loop-through-results-of-a-main-inputlookup-and-combine/m-p/273530#M82472</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup wlaa_hosts.csv | eval Host=split(HostList,",") | stats count by Host | join max=50 [| inputlookup secondlookup.csv | table MetricID AlertMsg ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Oct 2016 16:21:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-loop-through-results-of-a-main-inputlookup-and-combine/m-p/273530#M82472</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-26T16:21:46Z</dc:date>
    </item>
  </channel>
</rss>

