<?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: Why is search not returning result when using map? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498225#M138803</link>
    <description>&lt;P&gt;Tell us more about why &lt;CODE&gt;map is required for my xml dashboard form&lt;/CODE&gt;.  I do not believe that is true and the real solution is to NOT use &lt;CODE&gt;map&lt;/CODE&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2019 20:16:23 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-12-06T20:16:23Z</dc:date>
    <item>
      <title>Why is search not returning result when using map?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498222#M138800</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
My following search results records for Account:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="X" AND (sourcetype="A:Proxy" OR sourcetype="A:orderpusher")          
| where NOT isnull(Account)
| table _raw, _time, Account, User
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But if i use map (which is required for my xml dashboard form ), then I do not get any result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| map search="search  index=neonconnect_dev AND (sourcetype=NeonConnect:Proxy OR sourcetype=neonconnect:orderpusher)"
| where NOT isnull(Account) 
| table _raw, _time, Account, User
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My source data contains required data(file), still I can't see result. Kindly help. &lt;BR /&gt;
Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 16:55:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498222#M138800</guid>
      <dc:creator>sheikhazad</dc:creator>
      <dc:date>2019-12-06T16:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Why is search not returning result when using map?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498223#M138801</link>
      <description>&lt;P&gt;Correction: In both above queries I use same Index and SourceType (though it seems different in my question)&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 17:38:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498223#M138801</guid>
      <dc:creator>sheikhazad</dc:creator>
      <dc:date>2019-12-06T17:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Why is search not returning result when using map?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498224#M138802</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults
| map search="search index=_internal splunkd"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, @sheikhazad &lt;BR /&gt;
this query produces results.&lt;BR /&gt;
I think &lt;CODE&gt;| where NOT isnull(Account)&lt;/CODE&gt; is evil.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| map search="search index=neonconnect_dev  (sourcetype=NeonConnect:Proxy OR sourcetype=neonconnect:orderpusher)"
| table _raw, _time, Account, User
| search Account!=""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How about this?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 19:50:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498224#M138802</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-06T19:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why is search not returning result when using map?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498225#M138803</link>
      <description>&lt;P&gt;Tell us more about why &lt;CODE&gt;map is required for my xml dashboard form&lt;/CODE&gt;.  I do not believe that is true and the real solution is to NOT use &lt;CODE&gt;map&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 20:16:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498225#M138803</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-06T20:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Why is search not returning result when using map?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498226#M138804</link>
      <description>&lt;P&gt;It is almost certainly because you are not using the double-quotes for your &lt;CODE&gt;sourcetype&lt;/CODE&gt; value.  Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| map search="search index=\"X\" AND (sourcetype=\"A:Proxy\" OR sourcetype=\"A:orderpusher\")
| where NOT isnull(Account)
| table _raw, _time, Account, User"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Be aware that this limits both the run-time of your search and the size of your results set.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 20:18:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498226#M138804</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-06T20:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why is search not returning result when using map?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498227#M138805</link>
      <description>&lt;P&gt;Sadly it doesnt work. Pls see my main comment and I got result when I changed query and still need answers why changing my query works&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 20:25:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498227#M138805</guid>
      <dc:creator>sheikhazad</dc:creator>
      <dc:date>2019-12-06T20:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why is search not returning result when using map?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498228#M138806</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Problem solved but still want answer:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;My input source (which is log file) contains a lot of unnecessary data  like:&lt;/P&gt;

&lt;P&gt;2019-12-06 20:26:54,753 UTC : INFO  PC=I, PM=0, PI=0, PR=3&lt;BR /&gt;
2019-12-06 20:27:24,770 UTC : INFO  PC=I, PM=0, PI=0, PR=3&lt;/P&gt;

&lt;P&gt;And my log files are kept on updating with these data which DO NOT contain "Account" info which I am looking for.&lt;/P&gt;

&lt;P&gt;I changed the query to limit the data in index by adding "AND OrderStatus AND User AND Account" which makes sure that the data contains Account info like:&lt;/P&gt;

&lt;P&gt;2019-12-04 17:05:59,026 UTC : INFO  User=ASHAH,  &lt;STRONG&gt;Account&lt;/STRONG&gt;=AShah, AccountId=2, OrderStatus=Unknown, Status=Pending&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Old failed query:&lt;/STRONG&gt; &lt;BR /&gt;
| map search="search earliest=$$beginTimeFromMinTime$$ index=$$orders_index$$ AND (sourcetype="NeonConnect:Proxy" OR sourcetype="neonconnect:orderpusher") "&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;New successful query:&lt;/STRONG&gt;&lt;BR /&gt;
| map search="search earliest=$$beginTimeFromMinTime$$ index=$$orders_index$$ AND (sourcetype="NeonConnect:Proxy" OR sourcetype="neonconnect:orderpusher") AND OrderStatus AND User AND Account"&lt;/P&gt;

&lt;P&gt;My question is, how limiting data in Splunk Index solved the problem? Is a lot of data in Splunk Index cause unreliable result?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 20:46:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498228#M138806</guid>
      <dc:creator>sheikhazad</dc:creator>
      <dc:date>2019-12-06T20:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why is search not returning result when using map?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498229#M138807</link>
      <description>&lt;P&gt;Sadly it doesnt work. Pls see my main comment and I got result when I changed query and still need answers why changing my query works&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 20:52:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498229#M138807</guid>
      <dc:creator>sheikhazad</dc:creator>
      <dc:date>2019-12-06T20:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Why is search not returning result when using map?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498230#M138808</link>
      <description>&lt;P&gt;I want that all accounts are shown in my dasboard's drop down menu. Without map it doesnt work. Not sure why. I am 1 day old kid in splunk &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 21:01:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498230#M138808</guid>
      <dc:creator>sheikhazad</dc:creator>
      <dc:date>2019-12-06T21:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why is search not returning result when using map?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498231#M138809</link>
      <description>&lt;P&gt;Then let's solve that problem the right way.  Trust me: &lt;CODE&gt;map&lt;/CODE&gt; is not the answer.  Show us your dashboard XML.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 22:02:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498231#M138809</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-06T22:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why is search not returning result when using map?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498232#M138810</link>
      <description>&lt;P&gt;What exactly are you trying to achieve with map? Could you provide more details on what you're trying to achieve in the dashboard? There might be an alternative solution to it.&lt;/P&gt;

&lt;P&gt;In the meanwhile, for your query, I suspect the metadata is getting altered when results are passed from map. Try enclosing the whole query in map&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| map [ search index=neonconnect_dev  sourcetype IN ("NeonConnect:Proxy", "neonconnect:orderpusher")
  | where NOT isnull(Account)
  | table _raw, _time, Account, User]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 08 Dec 2019 04:43:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498232#M138810</guid>
      <dc:creator>arjunpkishore5</dc:creator>
      <dc:date>2019-12-08T04:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why is search not returning result when using map?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498233#M138811</link>
      <description>&lt;P&gt;Here is my dashboard and I am showing relevant queries only. With this queries with map, my problem is solved:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;query&amp;gt;
        | makeresults
        | addinfo
        | eval orders_index = "$Trading$"
        | eval beginTimeFromMinTime=relative_time(info_min_time, "@d")
        | map search="search earliest=$$beginTimeFromMinTime$$ index=$$orders_index$$ AND (sourcetype=\"NeonConnect:Proxy\" OR sourcetype=\"neonconnect:orderpusher\") AND OrderStatus AND User AND Account"
    &amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;$orderTime.earliest$&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;$orderTime.latest$&amp;lt;/latest&amp;gt;
    &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
&amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;........................................................................................&lt;BR /&gt;
Below query is to show Users in drop down&lt;BR /&gt;
.......................................................................................&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;        &amp;lt;input type="dropdown" token="tokFilterUser" searchWhenChanged="true"&amp;gt;
            &amp;lt;label&amp;gt;Filter on User&amp;lt;/label&amp;gt;
            &amp;lt;search base="baseProxySearch"&amp;gt;
                &amp;lt;query&amp;gt;
                    | where NOT isnull(User)
                    | dedup User
                    | eval User=lower(User)
                    | dedup User
                    | table User
                    | sort User
                &amp;lt;/query&amp;gt;
            &amp;lt;/search&amp;gt;
            &amp;lt;fieldForLabel&amp;gt;User&amp;lt;/fieldForLabel&amp;gt;
            &amp;lt;fieldForValue&amp;gt;User&amp;lt;/fieldForValue&amp;gt;
            &amp;lt;choice value="*"&amp;gt;All Users&amp;lt;/choice&amp;gt;
            &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
        &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;........................................................................................&lt;BR /&gt;
Below query is to show Accounts in drop down&lt;BR /&gt;
.......................................................................................&lt;BR /&gt;
            &lt;INPUT type="dropdown" token="tokFilterAccount" searchwhenchanged="true" /&gt;&lt;BR /&gt;
                &lt;LABEL&gt;Filter on Account&lt;/LABEL&gt;&lt;BR /&gt;
                &lt;SEARCH base="baseProxySearch"&gt;&lt;BR /&gt;
                    &lt;QUERY&gt;&lt;BR /&gt;
                        | where NOT isnull(Account) AND (User="$tokFilterUser$" OR "$tokFilterUser$"="&lt;EM&gt;")&lt;BR /&gt;
                        | dedup Account&lt;BR /&gt;
                        | eval Account=lower(Account)&lt;BR /&gt;
                        | dedup Account&lt;BR /&gt;
                        | table Account&lt;BR /&gt;
                        | sort Account&lt;BR /&gt;
                    &lt;/EM&gt;&lt;/QUERY&gt;&lt;BR /&gt;
                &lt;/SEARCH&gt;&lt;BR /&gt;
                &lt;FIELDFORLABEL&gt;Account&lt;/FIELDFORLABEL&gt;&lt;BR /&gt;
                &lt;FIELDFORVALUE&gt;Account&lt;/FIELDFORVALUE&gt;&lt;BR /&gt;
                &amp;lt;choice value=""&amp;gt;All Account Names&lt;BR /&gt;
                &lt;DEFAULT&gt;*&lt;/DEFAULT&gt;&lt;BR /&gt;
            &lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 11:01:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498233#M138811</guid>
      <dc:creator>sheikhazad</dc:creator>
      <dc:date>2019-12-11T11:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why is search not returning result when using map?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498234#M138812</link>
      <description>&lt;P&gt;Pls see my dashboard xml in main comment&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 11:02:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498234#M138812</guid>
      <dc:creator>sheikhazad</dc:creator>
      <dc:date>2019-12-11T11:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why is search not returning result when using map?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498235#M138813</link>
      <description>&lt;P&gt;Unfortunately, when I enclose map with [ ] as you suggested, it fails to work. Pls see my dashboard xml in main comment&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 11:04:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-search-not-returning-result-when-using-map/m-p/498235#M138813</guid>
      <dc:creator>sheikhazad</dc:creator>
      <dc:date>2019-12-11T11:04:14Z</dc:date>
    </item>
  </channel>
</rss>

