<?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 to sum if IP is observed in different days in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-to-sum-if-IP-is-observed-in-different-days/m-p/606481#M210943</link>
    <description>&lt;LI-CODE lang="markup"&gt;| stats count by ip date
| eventstats count as days by ip
| where days &amp;gt; 1
| xyseries ip date count
| addtotals col=f row=t&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 21 Jul 2022 11:44:49 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-07-21T11:44:49Z</dc:date>
    <item>
      <title>Search to sum if IP is observed in different days</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-sum-if-IP-is-observed-in-different-days/m-p/606474#M210939</link>
      <description>&lt;P&gt;Hello community&lt;/P&gt;&lt;P&gt;I’m trying to figure out how to perform a search which considers events on different days.&lt;/P&gt;&lt;P&gt;The idea is to search for an events by IP address and what I’d like to achieve is to check if the same IP (the same type of event) is observed in more than one specified timeframe (day/week/month). I started out with the following:&lt;/P&gt;&lt;PRE&gt;&amp;lt;base-search&amp;gt; earliest="-7d@d" latest="@d"&lt;BR /&gt;| stats count by ip date&lt;/PRE&gt;&lt;P&gt;And thought I could compare if IP address occurs on more than one date. Though I suppose I’d have to loop through all the results for each IP and I could not get the SPL to work at all.&lt;/P&gt;&lt;P&gt;Instead I figured that I could use something like&lt;/P&gt;&lt;PRE&gt;| bin span=1d _time&lt;BR /&gt;| stats count as c_ip by _time&lt;/PRE&gt;&lt;P&gt;I figured I could compare content of bins somehow, though the bins are still just by “date”.&lt;/P&gt;&lt;P&gt;I figured I’d be able to combine this with something like “eval” to get IP addresses which has events on more than one date in rage, preferably with number of events per date/bin and a total. Thi smay also need some "fillnull" or something.&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%"&gt;IP&lt;/TD&gt;&lt;TD width="25%"&gt;2022-06-29&lt;/TD&gt;&lt;TD width="25%"&gt;2022-07-01&lt;/TD&gt;&lt;TD width="12.5%"&gt;2022-07-02&lt;/TD&gt;&lt;TD width="6.25%"&gt;2022-07-12&lt;/TD&gt;&lt;TD width="6.25%"&gt;Sum&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;&amp;lt;ip1&amp;gt;&lt;/TD&gt;&lt;TD width="25%"&gt;6&lt;/TD&gt;&lt;TD width="25%"&gt;5&lt;/TD&gt;&lt;TD width="12.5%"&gt;8&lt;/TD&gt;&lt;TD width="6.25%"&gt;2&lt;/TD&gt;&lt;TD width="6.25%"&gt;21&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;&amp;lt;ip2&amp;gt;&lt;/TD&gt;&lt;TD width="25%"&gt;-&lt;/TD&gt;&lt;TD width="25%"&gt;5&lt;/TD&gt;&lt;TD width="12.5%"&gt;-&lt;/TD&gt;&lt;TD width="6.25%"&gt;4&lt;/TD&gt;&lt;TD width="6.25%"&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Though I am not having any success.&lt;/P&gt;&lt;P&gt;I hope I managed to articulate my idea here. If so, is what I’m aiming fore possible? Any suggestions/feedback is greatly appreciated, close enough would be a lot better than nothing &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;// G&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 10:38:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-sum-if-IP-is-observed-in-different-days/m-p/606474#M210939</guid>
      <dc:creator>fatsug</dc:creator>
      <dc:date>2022-07-21T10:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Search to sum if IP is observed in different days</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-sum-if-IP-is-observed-in-different-days/m-p/606478#M210941</link>
      <description>&lt;LI-CODE lang="markup"&gt;| stats count by ip date
| xyseries ip date count
| addtotals col=f row=t&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 21 Jul 2022 11:21:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-sum-if-IP-is-observed-in-different-days/m-p/606478#M210941</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-07-21T11:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Search to sum if IP is observed in different days</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-sum-if-IP-is-observed-in-different-days/m-p/606479#M210942</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;Great start, thank you!&lt;/P&gt;&lt;P&gt;So, this gives me the table I was after. However, it does not filter out only IP adresses which has events on more than one date. Taking the same example again and expanding&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;IP&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;2022-06-29&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;2022-07-01&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;2022-07-02&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;2022-07-12&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;Sum&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&amp;lt;ip1&amp;gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;6&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;5&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;8&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;21&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&amp;lt;ip2&amp;gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;-&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;5&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;-&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;4&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&amp;lt;ip3&amp;gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;-&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;23&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;-&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;-&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;23&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;In this example, &amp;lt;ip3&amp;gt; should not be included in the results as there are only events on a single date. I'm only looking for IPs with events on at least two different dates.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;// G&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 11:35:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-sum-if-IP-is-observed-in-different-days/m-p/606479#M210942</guid>
      <dc:creator>fatsug</dc:creator>
      <dc:date>2022-07-21T11:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Search to sum if IP is observed in different days</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-sum-if-IP-is-observed-in-different-days/m-p/606481#M210943</link>
      <description>&lt;LI-CODE lang="markup"&gt;| stats count by ip date
| eventstats count as days by ip
| where days &amp;gt; 1
| xyseries ip date count
| addtotals col=f row=t&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 21 Jul 2022 11:44:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-sum-if-IP-is-observed-in-different-days/m-p/606481#M210943</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-07-21T11:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Search to sum if IP is observed in different days</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-sum-if-IP-is-observed-in-different-days/m-p/606483#M210945</link>
      <description>&lt;P&gt;Nice! Big thank you, exactly what I needed&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 11:48:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-sum-if-IP-is-observed-in-different-days/m-p/606483#M210945</guid>
      <dc:creator>fatsug</dc:creator>
      <dc:date>2022-07-21T11:48:40Z</dc:date>
    </item>
  </channel>
</rss>

