<?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 search index for IP correlation in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/search-index-for-IP-correlation/m-p/489305#M136690</link>
    <description>&lt;P&gt;I am trying to do this logic.  Each "IF" I can do separately no issue.  However, I am not sure how to combine these two searches together as the second search is based off the output of the first. &lt;/P&gt;

&lt;P&gt;IF we see more than 10 failed events (1201 OR 1203)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;THEN IF we see more than 2 different users

    print ForwardedIP

    Pipe
        IF we see successful events (1200 OR 1202)

            Print Usernames
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The searches basically consist of &lt;/P&gt;

&lt;P&gt;index="auth"  EventCode=1201 OR EventCode=1203 | rex "(?[^&amp;lt;]+)"  | rex "(?[^&amp;lt;]+)" | stats values(UserId) as UserId by ForwardedIpAddress &lt;/P&gt;

&lt;P&gt;And then EventCode 1200 and 1202 for successful auth. &lt;/P&gt;

&lt;P&gt;If we see bad auths with multiple users from the same IP, and then we see a successful auth we want to know about it. &lt;/P&gt;</description>
    <pubDate>Mon, 09 Mar 2020 18:53:47 GMT</pubDate>
    <dc:creator>ldunzweiler</dc:creator>
    <dc:date>2020-03-09T18:53:47Z</dc:date>
    <item>
      <title>search index for IP correlation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-index-for-IP-correlation/m-p/489305#M136690</link>
      <description>&lt;P&gt;I am trying to do this logic.  Each "IF" I can do separately no issue.  However, I am not sure how to combine these two searches together as the second search is based off the output of the first. &lt;/P&gt;

&lt;P&gt;IF we see more than 10 failed events (1201 OR 1203)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;THEN IF we see more than 2 different users

    print ForwardedIP

    Pipe
        IF we see successful events (1200 OR 1202)

            Print Usernames
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The searches basically consist of &lt;/P&gt;

&lt;P&gt;index="auth"  EventCode=1201 OR EventCode=1203 | rex "(?[^&amp;lt;]+)"  | rex "(?[^&amp;lt;]+)" | stats values(UserId) as UserId by ForwardedIpAddress &lt;/P&gt;

&lt;P&gt;And then EventCode 1200 and 1202 for successful auth. &lt;/P&gt;

&lt;P&gt;If we see bad auths with multiple users from the same IP, and then we see a successful auth we want to know about it. &lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 18:53:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-index-for-IP-correlation/m-p/489305#M136690</guid>
      <dc:creator>ldunzweiler</dc:creator>
      <dc:date>2020-03-09T18:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: search index for IP correlation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-index-for-IP-correlation/m-p/489306#M136691</link>
      <description>&lt;P&gt;Give &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Map"&gt;map&lt;/A&gt; at try.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="auth" EventCode=1201 OR EventCode=1203 | rex "(?[^\&amp;lt;]+)" | rex "(?[^\&amp;lt;]+)" | stats values(UserId) as UserId by ForwardedIpAddress | map search="search index=auth EventCode=1200 OR EventCode=1202 UserId=$UserId$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Mar 2020 19:39:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-index-for-IP-correlation/m-p/489306#M136691</guid>
      <dc:creator>xavierashe</dc:creator>
      <dc:date>2020-03-09T19:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: search index for IP correlation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-index-for-IP-correlation/m-p/489307#M136692</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count user_count by UserId, EventCode, ForwardedIpAddress
| eval NEW_FIELD=if(user_count&amp;gt;=2 AND (EventCode=1201 OR EventCode=1202),"Multiple users, same IP","Nothing to see here")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Mar 2020 19:41:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-index-for-IP-correlation/m-p/489307#M136692</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2020-03-09T19:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: search index for IP correlation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-index-for-IP-correlation/m-p/489308#M136693</link>
      <description>&lt;P&gt;Not a good idea to use &lt;CODE&gt;map&lt;/CODE&gt; here.. You're already filtering down the eventcode's in the base of the search and iterating against each user_id field. What happens if there's hundreds of thousands of users? This is going to crush performance and does not scale well. Better approach is to use &lt;CODE&gt;stats&lt;/CODE&gt; and pre-process the data and feed that into a conditional statement&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 19:43:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-index-for-IP-correlation/m-p/489308#M136693</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2020-03-09T19:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: search index for IP correlation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-index-for-IP-correlation/m-p/489309#M136694</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="auth" AND (EventCode="1201" OR EventCode="1203" OR EventCode="1200" OR EventCode="1202")
| rex GarbledWhatever
| stats count(eval(EventCode="1201" OR EventCode="1203")) AS failed count(eval(EventCode="1200" OR EventCode="1202")) AS successful values(UserId) AS UserId dc(UserId) AS userCount BY ForwardedIpAddress
| where userCount&amp;gt;2 AND failed&amp;gt;10 AND successful&amp;gt;0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Mar 2020 05:58:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-index-for-IP-correlation/m-p/489309#M136694</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-03-10T05:58:05Z</dc:date>
    </item>
  </channel>
</rss>

