<?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: Filtering logs for a string only based on date in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709360#M239738</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please find the&amp;nbsp;current query:&lt;/P&gt;&lt;P&gt;index="index1" |search "slot" | rex field=msg "VF\s+slot\s+(?&amp;lt;slot_number&amp;gt;\d+)" | dedup msg | sort _time,host | stats range(_time) as downtime by host,slot_number&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jan 2025 18:08:38 GMT</pubDate>
    <dc:creator>shenoyveer</dc:creator>
    <dc:date>2025-01-21T18:08:38Z</dc:date>
    <item>
      <title>Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/703429#M238420</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a requirement where I need to filter the virtual machine outage occurrence from the kernel logs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have sent kernel logs to splunk based on some pattern. Now I have a issue for filtering those values in splunk.&lt;/P&gt;
&lt;P&gt;Here the requirement is, I need to filter the data only if one "string" has appeared in logs on same day.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example:&lt;/P&gt;
&lt;P&gt;I have following logs in splunk&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;date1: hv_vmbus: registering driver hv_netvsc

date1:hv_netvsc 000d3 eth0: VF dot 1 added

date1:hv_netvsc 000d3 eth0: VF dot 2 added

date1:hv_netvsc 000d3 eth0: VF dot 2 removed

date1:hv_netvsc 000d3 eth0: VF dot 1 removed

date2:hv_netvsc 000d3 eth0: VF dot 1 added

date2:hv_netvsc 000d3 eth0: VF dot 2 added

date2:hv_netvsc 000d3 eth0: VF dot 2 removed

date2:hv_netvsc 000d3 eth0: VF dot 1 removed&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;I need to fetch&amp;nbsp; the data for "&lt;STRONG&gt;dot&lt;/STRONG&gt;" only if "&lt;STRONG&gt;&lt;SPAN class=""&gt;hv&lt;/SPAN&gt;_vmbus&lt;/STRONG&gt;" pattern occured on same date. here I need only data in &lt;STRONG&gt;date1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;I tried following query but it isn't working for me.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;"index="index0" | search "dot" | rex field=msg "VF\s+dot\s+(?&amp;lt;dot_number&amp;gt;\d+)" | dedup msg | sort _time,host | stats range(_time) as n1 by host,dum_number"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Requesting help for achieving this requirement.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Veeresh Shenoy&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 17:04:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/703429#M238420</guid>
      <dc:creator>shenoyveer</dc:creator>
      <dc:date>2024-12-11T17:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/703433#M238421</link>
      <description>&lt;LI-CODE lang="markup"&gt;index="index0" 
``` Assuming you are actually searching _raw and that date has already been extracted ```
| rex "(?&amp;lt;vmbus&amp;gt;vmbus)"
| eventstats values(vmbus) as vmbus by date
| where vmbus="vmbus"
| search "dot" | rex field=msg "VF\s+dot\s+(?&amp;lt;dot_number&amp;gt;\d+)" | dedup msg | sort _time,host | stats range(_time) as n1 by host,dum_number"&lt;/LI-CODE&gt;&lt;P&gt;If this doesn't work for you, please share some actual (anonymised) events so we can see what you are actually dealing with rather than a confusing set of pseudo events.&lt;/P&gt;</description>
      <pubDate>Sun, 03 Nov 2024 12:28:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/703433#M238421</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-11-03T12:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/703473#M238428</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; for quick solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its working for me and doing some more tweaks in it.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 09:49:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/703473#M238428</guid>
      <dc:creator>shenoyveer</dc:creator>
      <dc:date>2024-11-04T09:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/706564#M239090</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need small tweak in same query.&lt;/P&gt;&lt;P&gt;I am trying to filter the same data but it should give only data which shouldn't have "&lt;STRONG&gt;hv_vmbus"&lt;/STRONG&gt;&amp;nbsp;pattern in same day&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 17:01:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/706564#M239090</guid>
      <dc:creator>shenoyveer</dc:creator>
      <dc:date>2024-12-11T17:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709196#M239688</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found your answer really helpful other day. now I am facing one small issue in it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The query is adding the time(number of seconds) of previous occurrences in dashboard.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;my requirement is, query should show the host name with date and number of seconds of downtime on that particular date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;current query is:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="index1" |search "slot" | rex field=msg "VF\s+slot\s+(?&amp;lt;slot_number&amp;gt;\d+)" | dedup msg | sort _time,host | stats range(_time) as downtime by host,slot_number&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here basically I am calculating network card slot downtime which occured in servers with number of seconds&lt;/P&gt;
&lt;P&gt;can you please help me with modifying the query?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 15:12:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709196#M239688</guid>
      <dc:creator>shenoyveer</dc:creator>
      <dc:date>2025-01-20T15:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709225#M239695</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Please share some actual (anonymised) events so we can see what you are actually dealing with.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, provide an example of the type of output you are looking for.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2025 10:14:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709225#M239695</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-01-20T10:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709344#M239730</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply .&lt;/P&gt;&lt;P&gt;Let me explain you my exact requirement.&lt;/P&gt;&lt;P&gt;Here I am trying to create a dashboard of visualizing and calculating downtime in VMs I manage.&lt;/P&gt;&lt;P&gt;I am trying to calculate based on log messages that are sending to splunk from servers.&lt;/P&gt;&lt;P&gt;Logs will have messages like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;timestamp&amp;gt; &amp;lt;nic-card-id&amp;gt; slot 1 removed&lt;/P&gt;&lt;P&gt;&amp;lt;timestamp&amp;gt; &amp;lt;nic-card-id&amp;gt; slot 3 added&lt;/P&gt;&lt;P&gt;I am calculating difference between 2 timestamps as a downtime and visualizing it.&lt;/P&gt;&lt;P&gt;Output dashboard I am expecting&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hostname, date , slot and the difference in time(downtime)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current query is calculating the difference, but its adding previous downtime as well.&lt;/P&gt;&lt;P&gt;my query is, I want it to show the downtime in host on 2 different dates instead of adding it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help me with tihs?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 17:01:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709344#M239730</guid>
      <dc:creator>shenoyveer</dc:creator>
      <dc:date>2025-01-21T17:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709358#M239736</link>
      <description>&lt;P&gt;What is you current query?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 18:02:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709358#M239736</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-01-21T18:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709360#M239738</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please find the&amp;nbsp;current query:&lt;/P&gt;&lt;P&gt;index="index1" |search "slot" | rex field=msg "VF\s+slot\s+(?&amp;lt;slot_number&amp;gt;\d+)" | dedup msg | sort _time,host | stats range(_time) as downtime by host,slot_number&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2025 18:08:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709360#M239738</guid>
      <dc:creator>shenoyveer</dc:creator>
      <dc:date>2025-01-21T18:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709446#M239783</link>
      <description>&lt;P&gt;Please provide some sample events which demonstrate the issue you have with your search&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 11:13:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709446#M239783</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-01-22T11:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709457#M239787</link>
      <description>&lt;P&gt;with the current query it is calculating the downtime between the slot removed and added but the real problem is, its calculating previous downtime and adding the time and making it as single event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my point is, I need the seperate events for every downtime in servers so looking for dashboard which should show&amp;nbsp;hostname, date, slot and the downtime&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 14:26:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709457#M239787</guid>
      <dc:creator>shenoyveer</dc:creator>
      <dc:date>2025-01-22T14:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709483#M239797</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Please provide some sample events which demonstrate the issue you have with your search&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2025 15:57:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709483#M239797</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-01-22T15:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709619#M239820</link>
      <description>&lt;P&gt;I am not getting it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you want me to share dashboard output?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 16:49:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709619#M239820</guid>
      <dc:creator>shenoyveer</dc:creator>
      <dc:date>2025-01-23T16:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709621#M239821</link>
      <description>&lt;P&gt;We can't see what might be wrong with your search if we can't see the actual events the search is running against. Please share some anonymised events which demonstrate the issue you are facing.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 18:41:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709621#M239821</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-01-23T18:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709648#M239830</link>
      <description>&lt;DIV&gt;when running index="index1" | search "slot"&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;its giving below events. which has time, hostname as well.&lt;/DIV&gt;&lt;DIV&gt;events:&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{"priority":6,"sequence":4704,"sec":695048,"usec":639227,"msg":"hv_netvsc 54243fd-13dc-6043-bddd-13dc6045bddd eth0: VF slot 1 added\n SUBSYSTEM=vmbus\n DEVICE=+vmbus:54243fd-13dc-6045-bddd-13dc6045bdda"}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{"priority":6,"sequence":4698,"sec":695037,"usec":497286,"msg":"hv_netvsc 54243fd-13dc-6043-bddd-13dc6045bddd eth0: VF slot 1 removed\n SUBSYSTEM=vmbus\n DEVICE=+vmbus:54243fd-13dc-6045-bddd-13dc6045bdda"}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;my requirement is I need a difference of time between message &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;removed &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;and &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;added&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;for the particular day. i.e It should not add previous events.&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 24 Jan 2025 04:09:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709648#M239830</guid>
      <dc:creator>shenoyveer</dc:creator>
      <dc:date>2025-01-24T04:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709808#M239868</link>
      <description>&lt;P&gt;Try something along these lines&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=msg "(?&amp;lt;action&amp;gt;added|removed)"
| eval added_time=if(action="added",_time,null())
| eval removed_time=if(action="removed",_time,null())
| sort 0 _time
| streamstats max(added_time) as added_time latest(removed_time) as removed_time by host slot_number
| eval downtime=if(action="added",added_time-removed_time,null())&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 27 Jan 2025 09:24:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709808#M239868</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-01-27T09:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709903#M239897</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the downtime field is not getting populated only. I tried converting it to epoch time and still same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you please look into it once?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2025 05:12:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709903#M239897</guid>
      <dc:creator>shenoyveer</dc:creator>
      <dc:date>2025-01-28T05:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709904#M239898</link>
      <description>&lt;P&gt;I have tried this in following way&lt;/P&gt;&lt;P&gt;index="index1" | search "slot" | rex field=msg "(?&amp;lt;action&amp;gt;added|removed)"&lt;BR /&gt;| eval added_time=if(action="added",strftime(_time, "%H:%M:%S"),null())&lt;BR /&gt;| eval removed_time=if(action="removed",strftime(_time, "%H:%M:%S"),null())&lt;BR /&gt;| sort 0 _time&lt;BR /&gt;| streamstats max(added_time) as added_time latest(removed_time) as removed_time by host slot&lt;BR /&gt;| eval downtime=if(isnotnull(added_time) AND isnotnull(removed_time), strptime(removed_time, "%H:%M:%S") - strptime(added_time, "%H:%M:%S"), 0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but the issue is, downtime is not getting calculated and its printing 0 always.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;need help in fixing this.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2025 05:51:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709904#M239898</guid>
      <dc:creator>shenoyveer</dc:creator>
      <dc:date>2025-01-28T05:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709918#M239901</link>
      <description>&lt;P&gt;Please share the event for which this is not working&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2025 08:25:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709918#M239901</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-01-28T08:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering logs for a string only based on date</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709998#M239921</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am getting same events which has "slot" messages&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;events:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{"priority":6,"sequence":4704,"sec":695048,"usec":639227,"msg":"hv_netvsc 54243fd-13dc-6043-bddd-13dc6045bddd eth0: VF slot 1 added&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{"priority":6,"sequence":4698,"sec":695037,"usec":497286,"msg":"hv_netvsc 54243fd-13dc-6043-bddd-13dc6045bddd eth0: VF slot 1 removed&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;query used :&lt;/DIV&gt;&lt;DIV&gt;index="index1" | search "slot" | rex field=msg "(?&amp;lt;action&amp;gt;added|removed)"| eval added_time=if(action="added",strftime(_time, "%H:%M:%S"),null())| eval removed_time=if(action="removed",strftime(_time, "%H:%M:%S"),null())| sort 0 _time| streamstats max(added_time) as added_time latest(removed_time) as removed_time by host, slot| eval added_epoch=strptime(added_time, "%H:%M:%S")| eval removed_epoch=strptime(removed_time, "%H:%M:%S")| eval downtime=if(isnotnull(added_epoch) AND isnotnull(removed_epoch), removed_epoch - added_epoch, 0)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;here I tried converting time to hour:min:sec and later into epoch to get the difference in seconds&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;but its not working and downtime is always showing 0&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 28 Jan 2025 17:17:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filtering-logs-for-a-string-only-based-on-date/m-p/709998#M239921</guid>
      <dc:creator>shenoyveer</dc:creator>
      <dc:date>2025-01-28T17:17:34Z</dc:date>
    </item>
  </channel>
</rss>

