<?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 find NOCLOSESESSION in logs daily in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570786#M198909</link>
    <description>&lt;P&gt;Hi&lt;BR /&gt;I have two field on my logfile &amp;lt;servername&amp;gt; &amp;lt;CLOSESESSION&amp;gt; need to know when CLOSESESSION is 0 each day by servername.&lt;BR /&gt;everyday I expect CLOSESESSION appear on my server logs, if one or more server has no CLOSESESSION it means something going wrong.&lt;/P&gt;&lt;P&gt;here is the spl:&lt;BR /&gt;index="my_index"&lt;BR /&gt;| rex field=source "(?&amp;lt;servername&amp;gt;\w+)."&lt;BR /&gt;| rex "CLOSESESSION\:\s+(?&amp;lt;CLOSESESSION&amp;gt;\w+)"&lt;/P&gt;&lt;P&gt;| table _time servername CLOSESESSION&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected output:&lt;/P&gt;&lt;P&gt;Servername&amp;nbsp; &amp;nbsp; &amp;nbsp;cause&lt;/P&gt;&lt;P&gt;Server10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NOCLOSESESSION&lt;/P&gt;&lt;P&gt;Server15&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NOCLOSESESSION&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any idea?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
    <pubDate>Wed, 13 Oct 2021 14:04:29 GMT</pubDate>
    <dc:creator>indeed_2000</dc:creator>
    <dc:date>2021-10-13T14:04:29Z</dc:date>
    <item>
      <title>find NOCLOSESESSION in logs daily</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570786#M198909</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;I have two field on my logfile &amp;lt;servername&amp;gt; &amp;lt;CLOSESESSION&amp;gt; need to know when CLOSESESSION is 0 each day by servername.&lt;BR /&gt;everyday I expect CLOSESESSION appear on my server logs, if one or more server has no CLOSESESSION it means something going wrong.&lt;/P&gt;&lt;P&gt;here is the spl:&lt;BR /&gt;index="my_index"&lt;BR /&gt;| rex field=source "(?&amp;lt;servername&amp;gt;\w+)."&lt;BR /&gt;| rex "CLOSESESSION\:\s+(?&amp;lt;CLOSESESSION&amp;gt;\w+)"&lt;/P&gt;&lt;P&gt;| table _time servername CLOSESESSION&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected output:&lt;/P&gt;&lt;P&gt;Servername&amp;nbsp; &amp;nbsp; &amp;nbsp;cause&lt;/P&gt;&lt;P&gt;Server10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NOCLOSESESSION&lt;/P&gt;&lt;P&gt;Server15&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NOCLOSESESSION&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any idea?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 14:04:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570786#M198909</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2021-10-13T14:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: find NOCLOSESESSION in logs daily</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570788#M198910</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my_index"
| rex field=source "(?&amp;lt;servername&amp;gt;\w+)."
| rex "CLOSESESSION\:\s+(?&amp;lt;CLOSESESSION&amp;gt;\w+)"
| stats dc(CLOSESESSION) as CLOSESESSIONs by servername
| where CLOSESESSIONs=0&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 13 Oct 2021 14:46:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570788#M198910</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2021-10-13T14:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: find NOCLOSESESSION in logs daily</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570789#M198911</link>
      <description>&lt;P&gt;Would something like this work for you?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my_index"
| rex field=source "(?&amp;lt;servername&amp;gt;\w+)."
| rex "CLOSESESSION\:\s+(?&amp;lt;CLOSESESSION&amp;gt;\w+)"
| fillnull value="NOCLOSESESSION" CLOSESESSION
| bin _time span=1d
| stats values(CLOSESESSION) as CLOSESESSION by _time servername
| eval CLOSESESSION=mvjoin(CLOSESESSION,"")
| where CLOSESESSION="NOCLOSESESSION"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 13 Oct 2021 14:49:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570789#M198911</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-13T14:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: find NOCLOSESESSION in logs daily</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570796#M198914</link>
      <description>&lt;P&gt;not work, here is the log:&lt;/P&gt;&lt;P&gt;23:54:00.957 app server 1 module: CLOSESESSION&lt;/P&gt;&lt;P&gt;23:54:00.958 app server 3 module: CLOSESESSION&lt;/P&gt;&lt;P&gt;23:54:00.959 app server 4 module: CLOSESESSION&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected output:&lt;/P&gt;&lt;P&gt;Servername&amp;nbsp; &amp;nbsp; &amp;nbsp;cause&lt;/P&gt;&lt;P&gt;Server2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NOCLOSESESSION&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 15:41:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570796#M198914</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2021-10-13T15:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: find NOCLOSESESSION in logs daily</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570798#M198915</link>
      <description>&lt;P&gt;not work, here is the log:&lt;/P&gt;&lt;P&gt;23:54:00.957 app server 1 module: CLOSESESSION&lt;/P&gt;&lt;P&gt;23:54:00.958 app server 3 module: CLOSESESSION&lt;/P&gt;&lt;P&gt;23:54:00.959 app server 4 module: CLOSESESSION&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected output:&lt;/P&gt;&lt;P&gt;Servername&amp;nbsp; &amp;nbsp; &amp;nbsp;cause&lt;/P&gt;&lt;P&gt;Server2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NOCLOSESESSION&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 15:42:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570798#M198915</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2021-10-13T15:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: find NOCLOSESESSION in logs daily</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570800#M198916</link>
      <description>&lt;P&gt;If those are your logs, the issue may be with the rex - try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\:\s+(?&amp;lt;CLOSESESSION&amp;gt;CLOSESESSION)"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 13 Oct 2021 15:48:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570800#M198916</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-13T15:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: find NOCLOSESESSION in logs daily</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570828#M198927</link>
      <description>&lt;P&gt;still have issue, i think need two search here, first extract all server names from file name that exist in path from metadata for faster result, then in second query check which one has not&amp;nbsp;CLOSESESSION&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;somthing like this:&lt;/P&gt;&lt;P&gt;1- list of all log files exist (per server)&lt;BR /&gt;| metadata type=sources index=my_index | table source&lt;/P&gt;&lt;P&gt;2-filter just lines have&amp;nbsp;CLOSESESSION&lt;BR /&gt;index="my_index" |&lt;FONT color="#FF0000"&gt; search CLOSESESSION&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#993366"&gt;&lt;STRONG&gt;| rex extracted server names of field "source" from STEP 1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;| rex "\:\s+(?&amp;lt;CLOSESESSION&amp;gt;CLOSESESSION)" |&lt;BR /&gt;| fillnull value="NOCLOSESESSION" CLOSESESSION&lt;BR /&gt;| bin _time span=1d&lt;BR /&gt;| stats values(CLOSESESSION) as CLOSESESSION by _time servername&lt;BR /&gt;| eval CLOSESESSION=mvjoin(CLOSESESSION,"")&lt;BR /&gt;| where CLOSESESSION="NOCLOSESESSION"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is the logs:&lt;/P&gt;&lt;P&gt;23:54:00.957 app server 1 module: CLOSESESSION&lt;/P&gt;&lt;P&gt;23:54:00.958 app server 3 module: CLOSESESSION&lt;/P&gt;&lt;P&gt;23:54:00.959 app server 4 module: CLOSESESSION&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected output step 1:&lt;/P&gt;&lt;P&gt;servernames&lt;/P&gt;&lt;P&gt;server 1&lt;/P&gt;&lt;P&gt;server 2&lt;/P&gt;&lt;P&gt;server 3&lt;/P&gt;&lt;P&gt;server 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected output step 2:&lt;/P&gt;&lt;P&gt;Servername&amp;nbsp; &amp;nbsp; &amp;nbsp;cause&lt;/P&gt;&lt;P&gt;Server2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NOCLOSESESSION&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 17:46:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570828#M198927</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2021-10-13T17:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: find NOCLOSESESSION in logs daily</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570840#M198933</link>
      <description>&lt;P&gt;You would basically need a lookup table file with all your server names (say lookup table file name will be&amp;nbsp; servers.csv with column servername) . Once you've this setup, you can run something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="my_index" | rex field=source "(?&amp;lt;servername&amp;gt;\w+)." | rex "CLOSESESSION\:\s+(?&amp;lt;CLOSESESSION&amp;gt;\w+)" | stats dc(CLOSESESSION) as CLOSESESSIONs by servername | append [| inputlookup servers.csv | table servername | eval CLOSESESSIONs=0] | stats max(CLOSESESSIONs) as CLOSESESSIONs by servername | where CLOSESESSIONs=0 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 18:39:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570840#M198933</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2021-10-13T18:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: find NOCLOSESESSION in logs daily</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570865#M198944</link>
      <description>&lt;P&gt;is it possible without csv file?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 21:59:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/570865#M198944</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2021-10-13T21:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: find NOCLOSESESSION in logs daily</title>
      <link>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/571074#M198996</link>
      <description>&lt;P&gt;after several try find solution&lt;/P&gt;&lt;P&gt;| metadata type=hosts index=my_index&lt;BR /&gt;| eval count=0&lt;BR /&gt;| table host count&lt;BR /&gt;| append&lt;BR /&gt;[ search index=my_index CLOSESESSION&lt;BR /&gt;| stats count by host ]&lt;BR /&gt;| stats sum(count) as number by host | where number=0&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 09:25:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/find-NOCLOSESESSION-in-logs-daily/m-p/571074#M198996</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2021-10-15T09:25:53Z</dc:date>
    </item>
  </channel>
</rss>

