<?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: Is it possible to list the filters of the initial search with the results of a subsearch? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-list-the-filters-of-the-initial-search-with/m-p/445726#M126424</link>
    <description>&lt;P&gt;Thank you, I really appreciate your help... I wonder if you can advise on another question I have "How do I correlate email events when the key-id is not defined in all events?"&lt;/P&gt;</description>
    <pubDate>Fri, 26 Oct 2018 12:58:07 GMT</pubDate>
    <dc:creator>Log_wrangler</dc:creator>
    <dc:date>2018-10-26T12:58:07Z</dc:date>
    <item>
      <title>Is it possible to list the filters of the initial search with the results of a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-list-the-filters-of-the-initial-search-with/m-p/445722#M126420</link>
      <description>&lt;P&gt;Here is the scenario.&lt;/P&gt;

&lt;P&gt;I have two indexes (index=AV and index=Packet_Analysis)&lt;/P&gt;

&lt;P&gt;I use index=AV to find attack signatures and the attacker IP, then I pipe the IP results from this search into index=Packet_Analysis to see if, and when, the attacker IP did a GET from a certain domain.&lt;/P&gt;

&lt;P&gt;For example&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=Packet_Analysis method=GET domain="bad.com" [search index=AV attack_sig="Bad stuff" attacker_IP=10.* |stats values(attacker_IP) as src_ip | table src_ip]  |stats values(src_ip) by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;fyi - in index=AV the  attacker_IP correlates to the src_ip in index=Packet_Analysis&lt;/P&gt;

&lt;P&gt;The results I need are Attacker_IP, Attack_time, Src_IP,  Get_time.&lt;/P&gt;

&lt;P&gt;So,I need to display the results from the initial search with the results of the second search (with the respective times as they are different)... &lt;/P&gt;

&lt;P&gt;I believe this can be done with fields and eval, however I need an example to get started.&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:45:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-list-the-filters-of-the-initial-search-with/m-p/445722#M126420</guid>
      <dc:creator>Log_wrangler</dc:creator>
      <dc:date>2020-09-29T21:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to list the filters of the initial search with the results of a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-list-the-filters-of-the-initial-search-with/m-p/445723#M126421</link>
      <description>&lt;P&gt;Try this.  Your times will come out as the unix time so you'll need to strftime to make them readable but I think this will get you what you want and then you don't need the subsearch. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   (index=Packet_Analysis method=GET domain="bad.com") OR (index=AV attack_sig="Bad stuff" attacker_IP=10.*)
    | eval Get_Time = case(index="Packet_Analysis", _time)
    | eval Attack_Time = case(index="AV", _time)
    | eval src_ip = if(index="AV",attacker_IP,src_ip)
    | stats values(Get_Time) as GetTime values(Attack_Time) as AttackTime by src_ip
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Oct 2018 14:20:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-list-the-filters-of-the-initial-search-with/m-p/445723#M126421</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2018-10-25T14:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to list the filters of the initial search with the results of a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-list-the-filters-of-the-initial-search-with/m-p/445724#M126422</link>
      <description>&lt;P&gt;Thank you for the reply.   It got me going.  I could not get it to work without coalesce, like this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=Packet_Analysis method=GET domain="bad.com") OR (index=AV attack_sig="Bad stuff" attacker_IP=10.*)
     | eval Get_Time = case(index="Packet_Analysis", _time) | eval GetTime=strftime(Get_Time,"%Y-%m-%dT%H:%M:%S.%Q")
     | eval Attack_Time = case(index="AV", _time) | eval AttackTime=strftime(Attack_Time,"%Y-%m-%dT%H:%M:%S.%Q")
     | eval HostIP=coalesce(Remote_IP, src_ip)
     | stats values(GetTime) as GetTime values(AttackTime) as AttackTime by HostIP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Before I accept your answer, I was hoping you could look at my query and advise if there is a better way to write the strfttime conversion... &lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 00:50:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-list-the-filters-of-the-initial-search-with/m-p/445724#M126422</guid>
      <dc:creator>Log_wrangler</dc:creator>
      <dc:date>2018-10-26T00:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to list the filters of the initial search with the results of a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-list-the-filters-of-the-initial-search-with/m-p/445725#M126423</link>
      <description>&lt;P&gt;if you want your GetTime/AttachTime to look like a timestamp  ex: 2018-10-26T08:34:00.000 then your strftime is good. &lt;/P&gt;

&lt;P&gt;If you want it to be more person readable you could do this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; eval GetTime=strftime(Get_Time,"%m/%d/%Y %I:%M:%S %p)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which would make it show like this:  10/16/2018 8:34:00 am&lt;/P&gt;

&lt;P&gt;There are a lot of options for formatting. &lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 12:39:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-list-the-filters-of-the-initial-search-with/m-p/445725#M126423</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2018-10-26T12:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to list the filters of the initial search with the results of a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-list-the-filters-of-the-initial-search-with/m-p/445726#M126424</link>
      <description>&lt;P&gt;Thank you, I really appreciate your help... I wonder if you can advise on another question I have "How do I correlate email events when the key-id is not defined in all events?"&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 12:58:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-list-the-filters-of-the-initial-search-with/m-p/445726#M126424</guid>
      <dc:creator>Log_wrangler</dc:creator>
      <dc:date>2018-10-26T12:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to list the filters of the initial search with the results of a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-list-the-filters-of-the-initial-search-with/m-p/445727#M126425</link>
      <description>&lt;P&gt;Without really knowing your data I don't think I can help much  but you can always post that as a new question and I'm sure someone would have a good answer (or two). &lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2018 14:12:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-list-the-filters-of-the-initial-search-with/m-p/445727#M126425</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2018-10-26T14:12:39Z</dc:date>
    </item>
  </channel>
</rss>

