<?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 use a field outside of map as map's search query? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600433#M209019</link>
    <description>&lt;P&gt;The results from the first search are not events. They're from&amp;nbsp;&lt;STRONG&gt;makeresults&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;eval&lt;/STRONG&gt;. I made a table for my desired indexes, hosts, sourcetypes, and sources.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jun 2022 09:51:04 GMT</pubDate>
    <dc:creator>yaharga</dc:creator>
    <dc:date>2022-06-03T09:51:04Z</dc:date>
    <item>
      <title>How to use a field outside of map as map's search query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600407#M209010</link>
      <description>&lt;P&gt;I have a field called&amp;nbsp;&lt;STRONG&gt;query&lt;/STRONG&gt; that's like so:&lt;/P&gt;&lt;PRE&gt;(index="abc" OR index="def") (host="ghi" OR host="jkl") (sourcetype="mno" sourcetype="pqr") (source="stu" source="vwx") "*yz*"&lt;/PRE&gt;&lt;P&gt;I am trying to leverage it in a map search:&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&amp;lt;search that gets me the above field&amp;gt; | map search="search $query$"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;It doesn't seem to work. How do I go about doing it if another way is possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to clarify, map doesn't have to be the only solution; I simply need a solution to use the&amp;nbsp;&lt;STRONG&gt;query&lt;/STRONG&gt; field to perform a search per row (in addition to stats count) to find the number of results returned for each search.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 08:57:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600407#M209010</guid>
      <dc:creator>yaharga</dc:creator>
      <dc:date>2022-06-03T08:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a field outside of map as map's search query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600414#M209014</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; &amp;lt;search that gets me the above field&amp;gt; | map search="search index=$index$ sourcetype=$sourcetype$ source=$source$ host=$host$"&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 03 Jun 2022 09:12:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600414#M209014</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-03T09:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a field outside of map as map's search query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600417#M209015</link>
      <description>&lt;P&gt;What should &lt;STRONG&gt;$index$&lt;/STRONG&gt; be to work with your solution? There are a variable number of indexes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;map search="search index=$index$"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;STRONG&gt;$index$&lt;/STRONG&gt; can be changed using &lt;STRONG&gt;eval&lt;/STRONG&gt; to whatever I want, so:&lt;/DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;PRE&gt;index="abc" OR index="def"&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;abc,def&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;"abc","def"&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;PRE&gt;abc&lt;BR /&gt;def&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I can't do&lt;/P&gt;&lt;PRE&gt;map search="search (index=$indexA$ OR index=$indexB$)"&lt;/PRE&gt;&lt;P&gt;because $index$ is a multivalue field that's variable in length.&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 Jun 2022 09:25:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600417#M209015</guid>
      <dc:creator>yaharga</dc:creator>
      <dc:date>2022-06-03T09:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a field outside of map as map's search query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600420#M209017</link>
      <description>&lt;P&gt;The map command works on each event in the pipeline i.e. the events returned by the search. Each event will have come from an index, a sourcetype, a source and a host. Each event could have different sets or the same values for each. The search in map as I showed should use the values for the event it is processing.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 09:33:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600420#M209017</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-03T09:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a field outside of map as map's search query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600433#M209019</link>
      <description>&lt;P&gt;The results from the first search are not events. They're from&amp;nbsp;&lt;STRONG&gt;makeresults&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;eval&lt;/STRONG&gt;. I made a table for my desired indexes, hosts, sourcetypes, and sources.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 09:51:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600433#M209019</guid>
      <dc:creator>yaharga</dc:creator>
      <dc:date>2022-06-03T09:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a field outside of map as map's search query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600437#M209021</link>
      <description>&lt;P&gt;OK sounds like similar to this&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/Using-the-map-command-to-run-searches-from-a-lookup/m-p/600309#M208976" target="_self"&gt;https://community.splunk.com/t5/Splunk-Search/Using-the-map-command-to-run-searches-from-a-lookup/m-p/600309#M208976&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 10:08:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600437#M209021</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-03T10:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a field outside of map as map's search query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600445#M209025</link>
      <description>&lt;PRE&gt;| makeresults&lt;BR /&gt;| eval query="search (index=\"abc\" OR index=\"def\") (host=\"ghi\" OR host=\"jkl\") (sourcetype=\"mno\" sourcetype=\"pqr\") (source=\"stu\" source=\"vwx\") \"*yz*\""&lt;BR /&gt;| map search="| makeresults | map search="$$$$query$$$$&lt;/PRE&gt;&lt;P&gt;Should the above work? I'm using it in a dashboard form.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 10:57:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600445#M209025</guid>
      <dc:creator>yaharga</dc:creator>
      <dc:date>2022-06-03T10:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a field outside of map as map's search query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600446#M209026</link>
      <description>&lt;P&gt;Double $ should be OK for dashboards&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-run-query-returned-from-Rest/m-p/598166#M208295" target="_self"&gt;https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-run-query-returned-from-Rest/m-p/598166#M208295&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 11:04:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-a-field-outside-of-map-as-map-s-search-query/m-p/600446#M209026</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-06-03T11:04:00Z</dc:date>
    </item>
  </channel>
</rss>

