<?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 feed results of a query into another query of a different time and index? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-feed-results-of-a-query-into-another-query-of-a-different/m-p/615788#M213987</link>
    <description>&lt;P class="lia-align-left"&gt;i tried this but it appears that there are 0 results. Also another thing i noticed is when i used the time modifiers, i.e. (earliest=-1h latest=now), it is relative to the time now, instead of relative to the datetime range i chose at the side bar. Is there a way to change the time modifiers to be relative to the datetime selected at the sidebar?&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Tue, 04 Oct 2022 09:56:12 GMT</pubDate>
    <dc:creator>charlottelimcl</dc:creator>
    <dc:date>2022-10-04T09:56:12Z</dc:date>
    <item>
      <title>How to feed results of a query into another query of a different time and index?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-feed-results-of-a-query-into-another-query-of-a-different/m-p/615624#M213938</link>
      <description>&lt;P&gt;Hi all, I am trying to feed results of a query into another of a different time and index and I'm facing issues with this.&lt;/P&gt;&lt;P&gt;Context: I want to look for any user activity across my servers on d+1 for list of user accounts which shows up as disabled on the active directory (windows event code=4725).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;From the search query below, I want to parse the list of usernames where count=1 and look for any user activity on d+1 onwards after earliest(_time) is recorded.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;index=useractivitylogs &lt;BR /&gt;[search index=wineventlog EventCode=4725&lt;BR /&gt;| eval timestamp=strftime(_time, "%Y-%m-%dT%H:%M"%S")&lt;BR /&gt;| stats count as count, earliest(timestamp) by&amp;nbsp;username&amp;nbsp;|&amp;nbsp;where&amp;nbsp;count=1]&lt;/PRE&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;Eventcode 4725 is recorded for these 2 users based on my inner search:&lt;/P&gt;&lt;PRE&gt;Timestamp | User:&lt;BR /&gt;5 September 2022 | Anna&lt;BR /&gt;10 September 2022 | Betty&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Then, I want to feed these results to identify any user activity found on any servers on d+1 after the recorded Timestamp.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 10:01:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-feed-results-of-a-query-into-another-query-of-a-different/m-p/615624#M213938</guid>
      <dc:creator>charlottelimcl</dc:creator>
      <dc:date>2022-10-03T10:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to feed results of a query into another query of a different time and index?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-feed-results-of-a-query-into-another-query-of-a-different/m-p/615625#M213939</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250014"&gt;@charlottelimcl&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have to put attention only to one thing: that the fields used as key for the correlation must have the same name in both the searches.&lt;/P&gt;&lt;P&gt;In other words, if the correlation key has a different file name, you have to rename the key fields in the subsearch to have the same field name of the main search and then explicitate the key fields using the fields command,&lt;/P&gt;&lt;P&gt;Then you can create your main search and sub search with all the parameters and time periods you need, for time periods.&lt;/P&gt;&lt;P&gt;something like this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=useractivitylogs [search 
   index=wineventlog EventCode=4725 earliest=-1h latest=now
   | eval timestamp=strftime(_time, "%Y-%m-%dT%H:%M"%S")
   | stats count as count by username 
   | where count=1
   fields username ]
| stats earliest(timestamp) AS timestamp count BY username
| eval timestamp=strftime(_time, "%Y-%m-%dT%H:%M"%S")&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;eriods, you have to set one (or both) of these searches with earliest and latest fields.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 10:09:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-feed-results-of-a-query-into-another-query-of-a-different/m-p/615625#M213939</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-03T10:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to feed results of a query into another query of a different time and index?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-feed-results-of-a-query-into-another-query-of-a-different/m-p/615644#M213941</link>
      <description>&lt;P&gt;Thank you, i will try this&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 12:59:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-feed-results-of-a-query-into-another-query-of-a-different/m-p/615644#M213941</guid>
      <dc:creator>charlottelimcl</dc:creator>
      <dc:date>2022-10-03T12:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to feed results of a query into another query of a different time and index?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-feed-results-of-a-query-into-another-query-of-a-different/m-p/615788#M213987</link>
      <description>&lt;P class="lia-align-left"&gt;i tried this but it appears that there are 0 results. Also another thing i noticed is when i used the time modifiers, i.e. (earliest=-1h latest=now), it is relative to the time now, instead of relative to the datetime range i chose at the side bar. Is there a way to change the time modifiers to be relative to the datetime selected at the sidebar?&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 09:56:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-feed-results-of-a-query-into-another-query-of-a-different/m-p/615788#M213987</guid>
      <dc:creator>charlottelimcl</dc:creator>
      <dc:date>2022-10-04T09:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to feed results of a query into another query of a different time and index?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-feed-results-of-a-query-into-another-query-of-a-different/m-p/615833#M213999</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250014"&gt;@charlottelimcl&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if your time borders are fices you can use earliest and latest as you like ,now isn't mandatory!&lt;/P&gt;&lt;P&gt;You can also use two timePickers, but for the second one use tokens in earliest and latest&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;earliest=$token2.earliest$ latest=$token2.latest$&lt;/LI-CODE&gt;&lt;P&gt;About 0 results, check the field names that must be exactly the same (field names are also case sensitive!), then check what are the results of the subquery and manually compare with the main search.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 14:32:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-feed-results-of-a-query-into-another-query-of-a-different/m-p/615833#M213999</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-04T14:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to feed results of a query into another query of a different time and index?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-feed-results-of-a-query-into-another-query-of-a-different/m-p/615931#M214028</link>
      <description>&lt;P&gt;Regarding the 0 results, this is my current query:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= useractivitylogs
[search 
   index=wineventlog EventCode=4725 earliest=-1h latest=now
   | eval timestamp=strftime(_time, "%Y-%m-%dT%H:%M"%S")
   | stats count as count by username 
   | where count=1
   fields username ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Without inputting any table or running any stats on it, it shows up as 0. Even if i were to change my index to the same as the subsearch index, it is still 0 results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, the subsearch results will list a column of many different usernames. I am trying to troubleshoot as to why running the subsearch results in 0. Will appreciate your help. Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 07:55:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-feed-results-of-a-query-into-another-query-of-a-different/m-p/615931#M214028</guid>
      <dc:creator>charlottelimcl</dc:creator>
      <dc:date>2022-10-05T07:55:01Z</dc:date>
    </item>
  </channel>
</rss>

