<?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 Searching the log pattern in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Searching-the-log-pattern/m-p/105514#M27351</link>
    <description>&lt;P&gt;2011-11-07 13:25:35,145 &lt;KERNEL&gt; FE (Exe 45) (pid 11788) destroyed&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:25:35,152 &lt;KERNEL&gt; PNG.exe (Exe 64) (pid 17286) destroyed&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:25:35,158 &lt;KERNEL&gt; K (Exe 44) (pid 11706) destroyed&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:25:35,160 &lt;KERNEL&gt; Kernel 44 released&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:25:39,976 &lt;KERNEL&gt; FE (Exe 66) initialized&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:25:41,386 &lt;KERNEL&gt; K (Exe 65) initialized&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:39:14,750 &lt;KERNEL&gt; Kernel 47 acquired&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:39:16,139 &lt;KERNEL&gt; PNG.exe (Exe 67) initialized&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:49:27,829 &lt;KERNEL&gt; FE (Exe 48) (pid 12912) destroyed&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:49:27,838 &lt;KERNEL&gt; PNG.exe (Exe 67) (pid 17786) destroyed&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:49:27,868 &lt;KERNEL&gt; K (Exe 47) (pid 12830) destroyed&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:49:27,869 &lt;KERNEL&gt; Kernel 47 released&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:49:27,982 &lt;KERNEL&gt; FE (Exe 69) initialized&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:49:29,524 &lt;KERNEL&gt; K (Exe 68) initialized&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:58:19,630 &lt;KERNEL&gt; Kernel 49 acquired&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:58:20,147 &lt;KERNEL&gt; PNG.exe (Exe 70) initialized&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;In the above log I only to search for log lines that has K and ends with initialized or destroyed. So my search result should  be&lt;/P&gt;

&lt;P&gt;2011-11-07 13:25:35,158 &lt;KERNEL&gt; K (Exe 44) (pid 11706) destroyed&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:25:41,386 &lt;KERNEL&gt; K (Exe 65) initialized&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:49:27,868 &lt;KERNEL&gt; K (Exe 47) (pid 12830) destroyed&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:49:29,524 &lt;KERNEL&gt; K (Exe 68) initialized&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;What might be the possible search query??&lt;/P&gt;</description>
    <pubDate>Mon, 07 Nov 2011 20:11:12 GMT</pubDate>
    <dc:creator>keshab</dc:creator>
    <dc:date>2011-11-07T20:11:12Z</dc:date>
    <item>
      <title>Searching the log pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-the-log-pattern/m-p/105514#M27351</link>
      <description>&lt;P&gt;2011-11-07 13:25:35,145 &lt;KERNEL&gt; FE (Exe 45) (pid 11788) destroyed&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:25:35,152 &lt;KERNEL&gt; PNG.exe (Exe 64) (pid 17286) destroyed&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:25:35,158 &lt;KERNEL&gt; K (Exe 44) (pid 11706) destroyed&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:25:35,160 &lt;KERNEL&gt; Kernel 44 released&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:25:39,976 &lt;KERNEL&gt; FE (Exe 66) initialized&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:25:41,386 &lt;KERNEL&gt; K (Exe 65) initialized&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:39:14,750 &lt;KERNEL&gt; Kernel 47 acquired&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:39:16,139 &lt;KERNEL&gt; PNG.exe (Exe 67) initialized&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:49:27,829 &lt;KERNEL&gt; FE (Exe 48) (pid 12912) destroyed&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:49:27,838 &lt;KERNEL&gt; PNG.exe (Exe 67) (pid 17786) destroyed&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:49:27,868 &lt;KERNEL&gt; K (Exe 47) (pid 12830) destroyed&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:49:27,869 &lt;KERNEL&gt; Kernel 47 released&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:49:27,982 &lt;KERNEL&gt; FE (Exe 69) initialized&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:49:29,524 &lt;KERNEL&gt; K (Exe 68) initialized&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:58:19,630 &lt;KERNEL&gt; Kernel 49 acquired&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:58:20,147 &lt;KERNEL&gt; PNG.exe (Exe 70) initialized&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;In the above log I only to search for log lines that has K and ends with initialized or destroyed. So my search result should  be&lt;/P&gt;

&lt;P&gt;2011-11-07 13:25:35,158 &lt;KERNEL&gt; K (Exe 44) (pid 11706) destroyed&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:25:41,386 &lt;KERNEL&gt; K (Exe 65) initialized&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:49:27,868 &lt;KERNEL&gt; K (Exe 47) (pid 12830) destroyed&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;2011-11-07 13:49:29,524 &lt;KERNEL&gt; K (Exe 68) initialized&lt;/KERNEL&gt;&lt;/P&gt;

&lt;P&gt;What might be the possible search query??&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2011 20:11:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-the-log-pattern/m-p/105514#M27351</guid>
      <dc:creator>keshab</dc:creator>
      <dc:date>2011-11-07T20:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Searching the log pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-the-log-pattern/m-p/105515#M27352</link>
      <description>&lt;P&gt;Maybe this would work but I am not sure what your field extraction is looking like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=&amp;lt;yoursourcetype&amp;gt; | rex field=_raw "\&amp;lt;kernel\&amp;gt;\s+(?&amp;lt;message&amp;gt;[^$]+)$" | search (message="*initialized" OR message="*destroyed")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Nov 2011 21:16:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-the-log-pattern/m-p/105515#M27352</guid>
      <dc:creator>tgow</dc:creator>
      <dc:date>2011-11-07T21:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Searching the log pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-the-log-pattern/m-p/105516#M27353</link>
      <description>&lt;P&gt;It didn't work..didn't return anything at all&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2011 17:15:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-the-log-pattern/m-p/105516#M27353</guid>
      <dc:creator>keshab</dc:creator>
      <dc:date>2011-11-08T17:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Searching the log pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-the-log-pattern/m-p/105517#M27354</link>
      <description>&lt;P&gt;Did you replace the sourcetype=&lt;SOURCETYPE&gt; with your unique sourcetype of your data? For example, &lt;/SOURCETYPE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=system | rex field=_raw "\&amp;lt;kernel\&amp;gt;\s+(?&amp;lt;message&amp;gt;[^$]+)$" | search (message="*initialized" OR message="*destroyed")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can also replace the sourcetype with either the source or host for instance, ie:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=kernel.log | rex field=_raw "\&amp;lt;kernel\&amp;gt;\s+(?&amp;lt;message&amp;gt;[^$]+)$" | search (message="*initialized" OR message="*destroyed")

host=mysystem123 | rex field=_raw "\&amp;lt;kernel\&amp;gt;\s+(?&amp;lt;message&amp;gt;[^$]+)$" | search (message="*initialized" OR message="*destroyed")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Nov 2011 17:20:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-the-log-pattern/m-p/105517#M27354</guid>
      <dc:creator>tgow</dc:creator>
      <dc:date>2011-11-08T17:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Searching the log pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-the-log-pattern/m-p/105518#M27355</link>
      <description>&lt;P&gt;Problem is with this rex field=_raw "&amp;lt;kernel&amp;gt;\s+(?&lt;MESSAGE&gt;[^$]+)$" It's not matching my any of log pattern&lt;/MESSAGE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2011 21:09:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-the-log-pattern/m-p/105518#M27355</guid>
      <dc:creator>keshab</dc:creator>
      <dc:date>2011-11-08T21:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Searching the log pattern</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-the-log-pattern/m-p/105519#M27356</link>
      <description>&lt;P&gt;I noticed that you missed a "\" in your last comment in front of the first "s+".  I tested the regex with your data and it worked. Make sure that your search is similar to the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=system | rex field=_raw "\&amp;lt;kernel\&amp;gt;\s+(?&amp;lt;message&amp;gt;[^$]+)$" | search (message="*initialized" OR message="*destroyed")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Nov 2011 21:13:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-the-log-pattern/m-p/105519#M27356</guid>
      <dc:creator>tgow</dc:creator>
      <dc:date>2011-11-08T21:13:51Z</dc:date>
    </item>
  </channel>
</rss>

