<?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 Neighbouring Events with localize and map only retrieving 2 days of results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Neighbouring-Events-with-localize-and-map-only-retrieving-2-days/m-p/219374#M64470</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am attempting to find the neighbouring events to a particular event over the last months set of data, but I'm only getting a subset of the results I need. &lt;/P&gt;

&lt;P&gt;My query, without the map command is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=hostname1 OR host=hostname2 NOT source="WinEventLog:Security" searchterm  | localize timebefore=30s
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which correctly returns results spread over the last month - most days there are a number of events logged. &lt;/P&gt;

&lt;P&gt;When I add the map command as below, I only receive results from today and yesterday. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=hostname1 OR host=hostname2 NOT source="WinEventLog:Security" searchterm  | localize timebefore=30s  | map search="search host=hostname1 OR host=hostname2 NOT source=WinEventLog:Security earliest=$starttime$ latest=$endtime$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How can I get all of the last months worth of results? &lt;/P&gt;

&lt;P&gt;Thanks, &lt;BR /&gt;
David&lt;/P&gt;</description>
    <pubDate>Thu, 05 Nov 2015 10:29:09 GMT</pubDate>
    <dc:creator>davidphi</dc:creator>
    <dc:date>2015-11-05T10:29:09Z</dc:date>
    <item>
      <title>Neighbouring Events with localize and map only retrieving 2 days of results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Neighbouring-Events-with-localize-and-map-only-retrieving-2-days/m-p/219374#M64470</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am attempting to find the neighbouring events to a particular event over the last months set of data, but I'm only getting a subset of the results I need. &lt;/P&gt;

&lt;P&gt;My query, without the map command is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=hostname1 OR host=hostname2 NOT source="WinEventLog:Security" searchterm  | localize timebefore=30s
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which correctly returns results spread over the last month - most days there are a number of events logged. &lt;/P&gt;

&lt;P&gt;When I add the map command as below, I only receive results from today and yesterday. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=hostname1 OR host=hostname2 NOT source="WinEventLog:Security" searchterm  | localize timebefore=30s  | map search="search host=hostname1 OR host=hostname2 NOT source=WinEventLog:Security earliest=$starttime$ latest=$endtime$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How can I get all of the last months worth of results? &lt;/P&gt;

&lt;P&gt;Thanks, &lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2015 10:29:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Neighbouring-Events-with-localize-and-map-only-retrieving-2-days/m-p/219374#M64470</guid>
      <dc:creator>davidphi</dc:creator>
      <dc:date>2015-11-05T10:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Neighbouring Events with localize and map only retrieving 2 days of results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Neighbouring-Events-with-localize-and-map-only-retrieving-2-days/m-p/219375#M64471</link>
      <description>&lt;P&gt;I was having the same problem.&lt;BR /&gt;
After some investigation, I found out the problem is not in 'localize' command, but rather in 'map'.&lt;BR /&gt;
As stated in &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0/SearchReference/map"&gt;Documentation&lt;/A&gt; , map will iterate for earch event found in the initial search with new time parameters. By default number of subsearch iterations is limited to 10. &lt;BR /&gt;
So after it reaches 10, i suppose it stops searching for other occurences.&lt;/P&gt;

&lt;P&gt;I solved it by adding 'maxsearches=3000' in map command section, right after ending doublequotes:&lt;/P&gt;

&lt;P&gt;so in your case:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; host=hostname1 OR host=hostname2 NOT source="WinEventLog:Security" searchterm  | localize timebefore=30s  | map search="search host=hostname1 OR host=hostname2 NOT source=WinEventLog:Security earliest=$starttime$ latest=$endtime$" maxsearches=3000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Documentation also states that "A message is generated if there are more search results than the maximum number that you specify. ".&lt;BR /&gt;
I guess, they should have added this notification to default use of 'map' without 'maxsearches' option, because result limitation seems weird wihout it.&lt;/P&gt;

&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2016 11:49:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Neighbouring-Events-with-localize-and-map-only-retrieving-2-days/m-p/219375#M64471</guid>
      <dc:creator>mank</dc:creator>
      <dc:date>2016-02-04T11:49:17Z</dc:date>
    </item>
  </channel>
</rss>

