<?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: Log4J Search slows down after a few minutes (Large Query) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Log4J-Search-slows-down-after-a-few-minutes-Large-Query/m-p/580144#M202147</link>
    <description>&lt;P&gt;Under some scenarios, this could be true. For example if you're looking at network or firewall logs:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If your FW IPS is configured for blocking log4j signature, it can only&amp;nbsp;block attempts that it was able to detect, as a result, you will only see blocked attempts.&lt;/LI&gt;&lt;LI&gt;Unless your firewall is decrypting HTTPS traffic, it won't be able to log the URL or other HTTP headers that may contain the JNDI string.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If you can't find the JDNI string in the logs that log4j has written to, it means that the target log4j is not configured to log that information and is not vulnerable.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jan 2022 17:30:05 GMT</pubDate>
    <dc:creator>johnhuang</dc:creator>
    <dc:date>2022-01-06T17:30:05Z</dc:date>
    <item>
      <title>Log4J Search slows down after a few minutes (Large Query)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Log4J-Search-slows-down-after-a-few-minutes-Large-Query/m-p/579712#M201993</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Log4J Query:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=*
| regex _raw="(\$|%24)(\{|%7B)([^jJ]*[jJ])([^nN]*[nN])([^dD]*[dD])([^iI]*[iI])(:|%3A|\$|%24|}|%7D)"
| eval action=coalesce(action_taken, elb_status_code, status)
| where NOT (cidrmatch("192.168.0.0/16",src_ip) OR cidrmatch("10.0.0.0/8",src_ip) OR cidrmatch("172.16.0.0/12",src_ip)) OR Country="United States"
| iplocation src_ip 
| eval notNULL=""
| fillnull value="unknown" notNULL, src_ip, dest_ip, action, url, Country
| stats count by src_ip, Country, dest_ip, url, action, sourcetype
| sort - count​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This checks anywhere where there is a sign of the Log4J exploit being used.&amp;nbsp; I've done field extraction on any sourcetypes returned by my previous query:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;index=*&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| regex _raw="(\$|%24)(\{|%7B)([^jJ]*[jJ])([^nN]*[nN])([^dD]*[dD])([^iI]*[iI])(:|%3A|\$|%24|}|%7D)"&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| stats count as "exploit attempts" by sourcetype&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;| sort - "exploit attempts"&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;I extracted fields so that I can get a table with&amp;nbsp;&lt;STRONG&gt;src_ip, Country, dest_ip, url, action, sourcetype, and count.&amp;nbsp;&lt;/STRONG&gt;I want to then use this query in subsequent queries to get information on if the exploit was successful, and if there is any other communication that follows.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The query works and I get results like this (fake results):&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%"&gt;&lt;STRONG&gt;src_ip&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;&lt;STRONG&gt;Country&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;&lt;STRONG&gt;dest_ip&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;&lt;STRONG&gt;url&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;&lt;STRONG&gt;action&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;&lt;STRONG&gt;sourcetype&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;&lt;STRONG&gt;count&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%"&gt;248.216.243.59&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;Unknown&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;192.168.1.148&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;192.168.1.148/&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;blocked&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;firewall&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%"&gt;207.191.80.208&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;US&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;192.168.1.216&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;192.168.1.216/&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;allowed&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;firewall&lt;/TD&gt;&lt;TD width="14.285714285714286%"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;H2&gt;&amp;nbsp;&lt;/H2&gt;&lt;H2&gt;&lt;STRONG&gt;&amp;nbsp;Problem being...&lt;/STRONG&gt;&lt;/H2&gt;&lt;H3&gt;&lt;STRONG&gt;The query runs really slow after a few minutes of running.&lt;/STRONG&gt;&lt;/H3&gt;&lt;P&gt;It starts out by doing millions of events every few seconds and slows down to doing thousands every few seconds.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some info from logs:&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;command.search, command.search.kv, &lt;/STRONG&gt;and&lt;STRONG&gt; dispatch.stream.remote&lt;/STRONG&gt;&amp;nbsp;take up the most time of the run.&lt;/LI&gt;&lt;LI&gt;I'm getting warnings in&amp;nbsp;&lt;STRONG&gt;search.log&lt;/STRONG&gt; like&amp;nbsp;&lt;STRONG&gt;"Max bucket size is larger than the index size limit" , "Invalid field alias specification in stanza".&amp;nbsp;&lt;/STRONG&gt;However, these don't seem to be the reason for the error.&lt;/LI&gt;&lt;LI&gt;Using &lt;STRONG&gt;high_perf &lt;/STRONG&gt;and &lt;STRONG&gt;Fast Mode&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If there is any more information I can add, then feel free to ask and I will edit.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jan 2022 19:39:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Log4J-Search-slows-down-after-a-few-minutes-Large-Query/m-p/579712#M201993</guid>
      <dc:creator>cyberdiver</dc:creator>
      <dc:date>2022-01-01T19:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Log4J Search slows down after a few minutes (Large Query)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Log4J-Search-slows-down-after-a-few-minutes-Large-Query/m-p/579717#M201996</link>
      <description>&lt;P&gt;I suspect part of the problem is &lt;FONT face="courier new,courier"&gt;index=*&lt;/FONT&gt;.&amp;nbsp; Searching every non-internal index you have is going to be slow, so much so that the construct is not allowed in many shops.&amp;nbsp; The search is probably running fast at first until memory pressure slows things down.&lt;/P&gt;&lt;P&gt;Try searching only the indexes known to contain log4j events.&amp;nbsp; You probably can skip the Cisco logs, for example.&lt;/P&gt;&lt;P&gt;I should point out that only failed log4stuff exploits will be in the logs.&amp;nbsp; Successful exploits are silent.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jan 2022 01:00:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Log4J-Search-slows-down-after-a-few-minutes-Large-Query/m-p/579717#M201996</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-01-02T01:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Log4J Search slows down after a few minutes (Large Query)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Log4J-Search-slows-down-after-a-few-minutes-Large-Query/m-p/579718#M201997</link>
      <description>&lt;P&gt;This makes sense.&amp;nbsp; I'm relatively new to Splunk, but the memory piece makes a lot of sense here.&amp;nbsp; I'm studious in wanting to know why you think only failed exploits will show up.&amp;nbsp; A lot of the logs I'm looking at are Blocked and Allowed attempts.&amp;nbsp; At least in terms of most of them being found in web requests which are all logged.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jan 2022 02:26:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Log4J-Search-slows-down-after-a-few-minutes-Large-Query/m-p/579718#M201997</guid>
      <dc:creator>cyberdiver</dc:creator>
      <dc:date>2022-01-02T02:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Log4J Search slows down after a few minutes (Large Query)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Log4J-Search-slows-down-after-a-few-minutes-Large-Query/m-p/579730#M202005</link>
      <description>&lt;P&gt;What I've read about log4stuff has said successful JNDI calls are silent, but perhaps your environment is different.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jan 2022 14:31:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Log4J-Search-slows-down-after-a-few-minutes-Large-Query/m-p/579730#M202005</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-01-02T14:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Log4J Search slows down after a few minutes (Large Query)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Log4J-Search-slows-down-after-a-few-minutes-Large-Query/m-p/580144#M202147</link>
      <description>&lt;P&gt;Under some scenarios, this could be true. For example if you're looking at network or firewall logs:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If your FW IPS is configured for blocking log4j signature, it can only&amp;nbsp;block attempts that it was able to detect, as a result, you will only see blocked attempts.&lt;/LI&gt;&lt;LI&gt;Unless your firewall is decrypting HTTPS traffic, it won't be able to log the URL or other HTTP headers that may contain the JNDI string.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If you can't find the JDNI string in the logs that log4j has written to, it means that the target log4j is not configured to log that information and is not vulnerable.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 17:30:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Log4J-Search-slows-down-after-a-few-minutes-Large-Query/m-p/580144#M202147</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-01-06T17:30:05Z</dc:date>
    </item>
  </channel>
</rss>

