<?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: Search for more than 1 url hit on a src_ip in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-for-more-than-1-url-hit-on-a-src-ip/m-p/545171#M154383</link>
    <description>&lt;P&gt;Thanks that worked. Just had to move transaction lower to get it to work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=security sourcetype=malware (connect OR disconnect OR recv)
| lookup dnslookup clientip as src_ip OUTPUT clienthost as fqdn
| rex field=fqdn "(?&amp;lt;hostname&amp;gt;[^.]+)\."
| rex field=_raw recv\:\s+User-Agent\:\s+(?&amp;lt;user_agent&amp;gt;.*)
| rex field=_raw recv\:\s+Host\:\s+(?&amp;lt;url&amp;gt;.*)
| eval url=replace(url,"\.","[.]")
| where isnotnull(url)
| eventstats dc(url) as url_count by src_ip
| where url_count&amp;gt;1
| transaction src_ip
| table _time hostname url user_agent src_ip fqdn dest_port url_count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One question though. What if there's a specific url, e.g. &lt;A href="http://www.badurl.com" target="_blank" rel="noopener"&gt;www.badurl.com&lt;/A&gt;&amp;nbsp;that I don't want&amp;nbsp; to be part of the url_count&amp;gt;1? I want it to show in the results even though it's 1 count but the only URL that should do that.&lt;/P&gt;&lt;P&gt;Also this combination of url count and transaction seems to have an unwanted effect of excluding a URL (&lt;A href="http://www.badurl2.com" target="_blank"&gt;www.badurl2.com&lt;/A&gt;) from results even though we have multiple hits on it back to back.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Mar 2021 15:57:02 GMT</pubDate>
    <dc:creator>fdevera</dc:creator>
    <dc:date>2021-03-24T15:57:02Z</dc:date>
    <item>
      <title>Search for more than 1 url hit on a src_ip</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-more-than-1-url-hit-on-a-src-ip/m-p/545012#M154336</link>
      <description>&lt;P&gt;Hi I have this search here where I want to limit the results to only events that have more than 1 url hit on an src_ip. How do I do that?&lt;BR /&gt;&lt;BR /&gt;index=security sourcetype=malware (connect OR disconnect OR recv)&lt;BR /&gt;| transaction src_ip&lt;BR /&gt;| lookup dnslookup clientip as src_ip OUTPUT clienthost as fqdn&lt;BR /&gt;| rex field=fqdn "(?&amp;lt;hostname&amp;gt;[^.]+)\."&lt;BR /&gt;| rex field=_raw recv\:\s+User-Agent\:\s+(?&amp;lt;user_agent&amp;gt;.*)&lt;BR /&gt;| rex field=_raw recv\:\s+Host\:\s+(?&amp;lt;url&amp;gt;.*)&lt;BR /&gt;| eval url=replace(url,"\.","[.]")&lt;BR /&gt;| where isnotnull(url)&lt;BR /&gt;| table _time hostname url user_agent src_ip fqdn dest_port&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 22:39:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-more-than-1-url-hit-on-a-src-ip/m-p/545012#M154336</guid>
      <dc:creator>fdevera</dc:creator>
      <dc:date>2021-03-23T22:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Search for more than 1 url hit on a src_ip</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-more-than-1-url-hit-on-a-src-ip/m-p/545031#M154342</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/199592"&gt;@fdevera&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Please try below;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=security sourcetype=malware (connect OR disconnect OR recv)
| transaction src_ip
| lookup dnslookup clientip as src_ip OUTPUT clienthost as fqdn
| rex field=fqdn "(?&amp;lt;hostname&amp;gt;[^.]+)\."
| rex field=_raw recv\:\s+User-Agent\:\s+(?&amp;lt;user_agent&amp;gt;.*)
| rex field=_raw recv\:\s+Host\:\s+(?&amp;lt;url&amp;gt;.*)
| eval url=replace(url,"\.","[.]")
| where isnotnull(url)
| eventstats dc(url) as url_count by src_ip
| where url_count&amp;gt;1
| table _time hostname url user_agent src_ip fqdn dest_port url_count&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Mar 2021 04:08:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-more-than-1-url-hit-on-a-src-ip/m-p/545031#M154342</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-03-24T04:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Search for more than 1 url hit on a src_ip</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-more-than-1-url-hit-on-a-src-ip/m-p/545171#M154383</link>
      <description>&lt;P&gt;Thanks that worked. Just had to move transaction lower to get it to work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=security sourcetype=malware (connect OR disconnect OR recv)
| lookup dnslookup clientip as src_ip OUTPUT clienthost as fqdn
| rex field=fqdn "(?&amp;lt;hostname&amp;gt;[^.]+)\."
| rex field=_raw recv\:\s+User-Agent\:\s+(?&amp;lt;user_agent&amp;gt;.*)
| rex field=_raw recv\:\s+Host\:\s+(?&amp;lt;url&amp;gt;.*)
| eval url=replace(url,"\.","[.]")
| where isnotnull(url)
| eventstats dc(url) as url_count by src_ip
| where url_count&amp;gt;1
| transaction src_ip
| table _time hostname url user_agent src_ip fqdn dest_port url_count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One question though. What if there's a specific url, e.g. &lt;A href="http://www.badurl.com" target="_blank" rel="noopener"&gt;www.badurl.com&lt;/A&gt;&amp;nbsp;that I don't want&amp;nbsp; to be part of the url_count&amp;gt;1? I want it to show in the results even though it's 1 count but the only URL that should do that.&lt;/P&gt;&lt;P&gt;Also this combination of url count and transaction seems to have an unwanted effect of excluding a URL (&lt;A href="http://www.badurl2.com" target="_blank"&gt;www.badurl2.com&lt;/A&gt;) from results even though we have multiple hits on it back to back.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 15:57:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-more-than-1-url-hit-on-a-src-ip/m-p/545171#M154383</guid>
      <dc:creator>fdevera</dc:creator>
      <dc:date>2021-03-24T15:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Search for more than 1 url hit on a src_ip</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-more-than-1-url-hit-on-a-src-ip/m-p/545177#M154386</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/199592"&gt;@fdevera&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can add it to where condition; please try below.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=security sourcetype=malware (connect OR disconnect OR recv)
| lookup dnslookup clientip as src_ip OUTPUT clienthost as fqdn
| rex field=fqdn "(?&amp;lt;hostname&amp;gt;[^.]+)\."
| rex field=_raw recv\:\s+User-Agent\:\s+(?&amp;lt;user_agent&amp;gt;.*)
| rex field=_raw recv\:\s+Host\:\s+(?&amp;lt;url&amp;gt;.*)
| eval url=replace(url,"\.","[.]")
| where isnotnull(url)
| eventstats dc(url) as url_count by src_ip
| where url_count&amp;gt;1 OR url="www.badurl.com"
| transaction src_ip
| table _time hostname url user_agent src_ip fqdn dest_port url_count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 15:40:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-more-than-1-url-hit-on-a-src-ip/m-p/545177#M154386</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-03-24T15:40:00Z</dc:date>
    </item>
  </channel>
</rss>

