<?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 Can I search retrospectively in splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-Can-I-search-retrospectively-in-splunk/m-p/673787#M230687</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263893"&gt;@darkhorse91&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you could use join command but I don't hint because you'll have a very slow search.&lt;/P&gt;&lt;P&gt;Otherwise, you could run something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=retrospective earliest=-30d latest=now) OR (index=current earliest=-24h latest=now)
| stats 
   values(field_retrospective_1) AS field_retrospective_1   
   values(field_retrospective_2) AS field_retrospective_2
   values(field_retrospective_3) AS field_retrospective_3
   values(field_current_1) AS field_current_1
   values(field_current_2) AS field_current_2
   BY my_field&lt;/LI-CODE&gt;&lt;P&gt;if you want also to add the condition that my_field must be present in both the indexes, you could run&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=retrospective earliest=-30d latest=now) OR (index=current earliest=-24h latest=now)
| stats 
   values(field_retrospective_1) AS field_retrospective_1   
   values(field_retrospective_2) AS field_retrospective_2
   values(field_retrospective_3) AS field_retrospective_3
   values(field_current_1) AS field_current_1
   values(field_current_2) AS field_current_2
   dc(indexes) AS index_count
   BY my_field
| where index_count=2&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jan 2024 14:04:26 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2024-01-10T14:04:26Z</dc:date>
    <item>
      <title>How Can I search retrospectively in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Can-I-search-retrospectively-in-splunk/m-p/673767#M230678</link>
      <description>&lt;P&gt;I am working on building a query to search retrospectively and potentially run a report.&lt;/P&gt;&lt;P&gt;Let's say the first search is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=some_index "inconsistencies" | dedup someField&lt;/LI-CODE&gt;&lt;P&gt;and the second is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=some_index "consistent" someField IN (fieldValuesFromPrevMsg) | dedup someField&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to check whether a field seen in the first search is part of the second search (which has a slightly different query but has same field) in a custom time frame.(could be in the future relative to the first search or in the past)&lt;/P&gt;&lt;P&gt;I'm new to splunk, can someone please help me with this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 11:17:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Can-I-search-retrospectively-in-splunk/m-p/673767#M230678</guid>
      <dc:creator>darkhorse91</dc:creator>
      <dc:date>2024-01-10T11:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I search retrospectively in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Can-I-search-retrospectively-in-splunk/m-p/673769#M230680</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263893"&gt;@darkhorse91&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have to use a subsearch, with the limitation that you cannot have more than 50,000 results from the subsearch,&amp;nbsp;&lt;/P&gt;&lt;P&gt;if:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;the current search is on index=current and runs on the last day,&lt;/LI&gt;&lt;LI&gt;the retrospetive search runs on index=retrospective and the last 30 days,&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;the common field is my_field and it has the same name in both the searches,&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;you could try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=retrospective earliest=-30d latest=now [ search index=current earliest=-24h latest=now) | dedup my_field | fields my_field ]&lt;/LI-CODE&gt;&lt;P&gt;You have to adapt my approach to your searches.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 11:17:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Can-I-search-retrospectively-in-splunk/m-p/673769#M230680</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-01-10T11:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I search retrospectively in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Can-I-search-retrospectively-in-splunk/m-p/673780#M230683</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Amazing. This works. Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have Another query: how can I print those field values from subsearch that are not in the main search?&lt;/P&gt;&lt;P&gt;In this case the results of the main search is a superset of the subsearch&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 12:37:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Can-I-search-retrospectively-in-splunk/m-p/673780#M230683</guid>
      <dc:creator>darkhorse91</dc:creator>
      <dc:date>2024-01-10T12:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I search retrospectively in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-Can-I-search-retrospectively-in-splunk/m-p/673787#M230687</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263893"&gt;@darkhorse91&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you could use join command but I don't hint because you'll have a very slow search.&lt;/P&gt;&lt;P&gt;Otherwise, you could run something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=retrospective earliest=-30d latest=now) OR (index=current earliest=-24h latest=now)
| stats 
   values(field_retrospective_1) AS field_retrospective_1   
   values(field_retrospective_2) AS field_retrospective_2
   values(field_retrospective_3) AS field_retrospective_3
   values(field_current_1) AS field_current_1
   values(field_current_2) AS field_current_2
   BY my_field&lt;/LI-CODE&gt;&lt;P&gt;if you want also to add the condition that my_field must be present in both the indexes, you could run&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=retrospective earliest=-30d latest=now) OR (index=current earliest=-24h latest=now)
| stats 
   values(field_retrospective_1) AS field_retrospective_1   
   values(field_retrospective_2) AS field_retrospective_2
   values(field_retrospective_3) AS field_retrospective_3
   values(field_current_1) AS field_current_1
   values(field_current_2) AS field_current_2
   dc(indexes) AS index_count
   BY my_field
| where index_count=2&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 14:04:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-Can-I-search-retrospectively-in-splunk/m-p/673787#M230687</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-01-10T14:04:26Z</dc:date>
    </item>
  </channel>
</rss>

