<?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: Finding fields in more than one list (subsearch? append?) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/99004#M25560</link>
    <description>&lt;P&gt;Solved that.  Just changed the join type and some magically it's doing the right thing now.  Must be the Psychic app that I put on Splunk.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Oct 2011 21:13:15 GMT</pubDate>
    <dc:creator>howyagoin</dc:creator>
    <dc:date>2011-10-27T21:13:15Z</dc:date>
    <item>
      <title>Finding fields in more than one list (subsearch? append?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/98994#M25550</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a list of login events, some which fail, some which succeed.  In some cases, the IP address that succeeds is different than the one that failed.&lt;/P&gt;

&lt;P&gt;I'm looking for a way to find the failures, extract the account name and IP address, then search for succeeds by the same username and generate a table of user, failure IP and succeed IP.&lt;/P&gt;

&lt;P&gt;Both subsearches and append seem like they might help me get there, but I can't seem to find the right combination.&lt;/P&gt;

&lt;P&gt;Pretend the log entry looks like:&lt;/P&gt;

&lt;PRE&gt;
Login succeeded for fred from 1.2.3.4
Login failure from 5.6.7.8 for fred
&lt;/PRE&gt;

&lt;P&gt;I'd like a table that appeared as:&lt;/P&gt;

&lt;PRE&gt;
User     Fail     Succeed
fred     5.6.7.8  1.2.3.4
&lt;/PRE&gt;

&lt;P&gt;What's the best way to get there?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2011 06:36:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/98994#M25550</guid>
      <dc:creator>howyagoin</dc:creator>
      <dc:date>2011-10-27T06:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Finding fields in more than one list (subsearch? append?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/98995#M25551</link>
      <description>&lt;P&gt;What if there are multiple succeeds/fails for a single user?  Is there a time requirement or a sequence of events requirement?&lt;/P&gt;

&lt;P&gt;Sorry to ask more questions, but I have a couple of ideas, and your answers may make my ideas either useful or stupid!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2011 06:46:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/98995#M25551</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2011-10-27T06:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Finding fields in more than one list (subsearch? append?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/98996#M25552</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I believe this will work for you, as far as I understand your question. Assuming that you have user names, login-status (i.e. succeeded/failure) and ip-addresses extracted into fields - let's call them '&lt;CODE&gt;userID&lt;/CODE&gt;', '&lt;CODE&gt;clientIP&lt;/CODE&gt;' and '&lt;CODE&gt;loginStatus&lt;/CODE&gt;' for now, you can the execute a search as follows;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; sourcetype=&amp;lt;your_sourcetype&amp;gt; [search loginStatus="failure" | fields userID] | chart values(clientIP) over userID by loginStatus
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please note that I have used different log data to play around with (access_combined logs, charting with clientip, status and method).  &lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2011 07:16:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/98996#M25552</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-10-27T07:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: Finding fields in more than one list (subsearch? append?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/98997#M25553</link>
      <description>&lt;P&gt;Heh, completely valid questions.&lt;/P&gt;

&lt;P&gt;In an ideal universe, I'd like a list of mvcombine type output where all of the Fails and all of the Succeeds are lumped together (unique IP addresses), even a delimiter separated list of Failed IPs and Succeed IPs would be fine.&lt;/P&gt;

&lt;P&gt;Time isn't so important for this issue as I'm happy with the timerange in the query settling that.  I'd love to know how to get the &lt;EM&gt;first&lt;/EM&gt; occurrence of a given IP for each fail/succeed, but realise that may be complicated.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2011 07:19:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/98997#M25553</guid>
      <dc:creator>howyagoin</dc:creator>
      <dc:date>2011-10-27T07:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Finding fields in more than one list (subsearch? append?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/98998#M25554</link>
      <description>&lt;P&gt;Interesting suggestion, I'll have to try that - issue for me at the moment is that the fields are being extracted through "| rex field=_raw ..." statements which is making matching the condition where there has to be a failure event AND a success event for the same user trickier.  But I see options here, thanks, will poke at it some more.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2011 07:55:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/98998#M25554</guid>
      <dc:creator>howyagoin</dc:creator>
      <dc:date>2011-10-27T07:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Finding fields in more than one list (subsearch? append?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/98999#M25555</link>
      <description>&lt;P&gt;Here is what I have, although the result is not formatted as I would like...&lt;/P&gt;

&lt;P&gt;I assumed the field names are &lt;STRONG&gt;user&lt;/STRONG&gt; and &lt;STRONG&gt;ip&lt;/STRONG&gt; for the data that you need.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Login succeeded" | stats values(ip) as Failed_Login_IPs by user | 
join user type=outer [search "Login failure" | stats values(ip) as Successful_Login_IPs by user ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is not fast, although the speed may be okay if you keep the time range relatively small.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2011 08:04:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/98999#M25555</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2011-10-27T08:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Finding fields in more than one list (subsearch? append?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/99000#M25556</link>
      <description>&lt;P&gt;Just saw your last comment. You can put the rex commands inline - you will have to extract the fields twice, as the two searches are independent of each other. So add the rex just before each of the stats commands.&lt;/P&gt;

&lt;P&gt;There is probably something cool you could do with macros, so that you wouldn't have to actually type out the same rex command twice, but I am too tired now to think it through.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2011 08:07:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/99000#M25556</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2011-10-27T08:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Finding fields in more than one list (subsearch? append?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/99001#M25557</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
if you cannot (for some reason) make the field extractions permanent, you might be better off with Iguinn's solution below - as I could not get my version to work with rex, since my subsearch returns values needed for the outer search. Then again, there is probably a solution to that as well. I just don't have it.&lt;/P&gt;

&lt;P&gt;/k&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2011 09:53:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/99001#M25557</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-10-27T09:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Finding fields in more than one list (subsearch? append?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/99002#M25558</link>
      <description>&lt;P&gt;This worked once I remembered to tweak the rex a bit - the only thing I'm not sure of now: How do I &lt;EM&gt;only&lt;/EM&gt; display values which have both succeeded and failed values?  If John only fails, or John only succeeds, I care less (for this report)...its when he fails and succeeds during the course of the time-range that I care.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2011 20:43:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/99002#M25558</guid>
      <dc:creator>howyagoin</dc:creator>
      <dc:date>2011-10-27T20:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Finding fields in more than one list (subsearch? append?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/99003#M25559</link>
      <description>&lt;P&gt;If you want ONLY matches that have both succeeded and failed values, change type=outer to type=inner&lt;/P&gt;

&lt;P&gt;That's it!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2011 21:07:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/99003#M25559</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2011-10-27T21:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Finding fields in more than one list (subsearch? append?)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/99004#M25560</link>
      <description>&lt;P&gt;Solved that.  Just changed the join type and some magically it's doing the right thing now.  Must be the Psychic app that I put on Splunk.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2011 21:13:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-fields-in-more-than-one-list-subsearch-append/m-p/99004#M25560</guid>
      <dc:creator>howyagoin</dc:creator>
      <dc:date>2011-10-27T21:13:15Z</dc:date>
    </item>
  </channel>
</rss>

