<?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: Index selected events of log file in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142386#M39506</link>
    <description>&lt;P&gt;Are you indexing these events on a local Splunk instance or are you forwarding these from your machine to a separate indexer?&lt;/P&gt;</description>
    <pubDate>Thu, 14 Nov 2013 14:33:19 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2013-11-14T14:33:19Z</dc:date>
    <item>
      <title>Index selected events of log file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142381#M39501</link>
      <description>&lt;P&gt;I have a log file namned: wrapper.log&lt;BR /&gt;
This log file has two different type of events defined with the prefix INFO or ERROR.&lt;BR /&gt;
I want to index only the ERROR events but am not getting it to work.&lt;BR /&gt;
Im on a mac.&lt;/P&gt;

&lt;P&gt;Here is my log file:&lt;/P&gt;

&lt;P&gt;ERROR   | jvm 1    | 2013/05/03 10:47:52 Test_error&lt;BR /&gt;&lt;BR /&gt;
INFO   | jvm 1    | 2013/05/03 10:48:52 Test&lt;BR /&gt;&lt;BR /&gt;
ERROR   | jvm 1    | 2013/05/03 10:49:52 Test_error&lt;BR /&gt;&lt;BR /&gt;
INFO   | jvm 1    | 2013/05/03 10:50:52 Test&lt;BR /&gt;&lt;BR /&gt;
ERROR   | jvm 1    | 2013/05/03 10:51:52 Test_error&lt;BR /&gt;&lt;BR /&gt;
INFO   | jvm 1    | 2013/05/03 10:52:52 Test&lt;BR /&gt;&lt;BR /&gt;
ERROR   | jvm 1    | 2013/05/03 10:53:52 Test_error&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;inputs.conf:&lt;BR /&gt;&lt;BR /&gt;
[monitor:///Users/carljohan/logs/wrapper.log]&lt;BR /&gt;&lt;BR /&gt;
disabled=false&lt;BR /&gt;&lt;BR /&gt;
sourcetype = ESB_Wrapper&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;props.conf:&lt;BR /&gt;&lt;BR /&gt;
[ESB_Wrapper]&lt;BR /&gt;&lt;BR /&gt;
SHOULD_LINEMERGE=false&lt;BR /&gt;&lt;BR /&gt;
LINE_BREAKER = ([\r\n]+)[0-9]+-[0-9]+-[0-9]+\s+&lt;BR /&gt;&lt;BR /&gt;
TIME_FORMAT = %Y/%m/%d %H:%M:%S,%3N&lt;BR /&gt;&lt;BR /&gt;
TRANSFORMS-set= setnull,setparsing&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;tranfsforms.conf&lt;BR /&gt;&lt;BR /&gt;
[setnull]&lt;BR /&gt;&lt;BR /&gt;
REGEX = .&lt;BR /&gt;&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;&lt;BR /&gt;
FORMAT = nullQueue&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;[setparsing]&lt;BR /&gt;&lt;BR /&gt;
REGEX = (\W|^)ERROR(\W|$)&lt;BR /&gt;&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;&lt;BR /&gt;
FORMAT = indexQueue&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;With this setup all events are still being indexed.&lt;BR /&gt;
What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:16:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142381#M39501</guid>
      <dc:creator>carljohan</dc:creator>
      <dc:date>2020-09-28T15:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Index selected events of log file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142382#M39502</link>
      <description>&lt;P&gt;The configs look good except for the REGEX.  Is what you posted missing characters?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2013 13:57:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142382#M39502</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-11-14T13:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Index selected events of log file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142383#M39503</link>
      <description>&lt;P&gt;I posted the complete .conf content. &lt;BR /&gt;
What should I change in the REGEX?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2013 13:57:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142383#M39503</guid>
      <dc:creator>carljohan</dc:creator>
      <dc:date>2013-11-14T13:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Index selected events of log file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142384#M39504</link>
      <description>&lt;P&gt;I'm not a regex wizard, but I should think ^ERROR should work.  You will need to restart splunkd on the indexer for the change to take effect.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2013 14:06:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142384#M39504</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-11-14T14:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Index selected events of log file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142385#M39505</link>
      <description>&lt;P&gt;I tried with  ^ERROR which gives me the following transforms.conf and restarted Splunk but it did not work.&lt;/P&gt;

&lt;P&gt;[setnull]&lt;BR /&gt;
REGEX = .&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = nullQueue&lt;/P&gt;

&lt;P&gt;[setparsing]&lt;BR /&gt;
REGEX = ^ERROR&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = indexQueue&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2013 14:12:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142385#M39505</guid>
      <dc:creator>carljohan</dc:creator>
      <dc:date>2013-11-14T14:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Index selected events of log file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142386#M39506</link>
      <description>&lt;P&gt;Are you indexing these events on a local Splunk instance or are you forwarding these from your machine to a separate indexer?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2013 14:33:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142386#M39506</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-11-14T14:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Index selected events of log file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142387#M39507</link>
      <description>&lt;P&gt;They are indexed on the local splunk instance. No forwarders are included in the setup.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2013 14:34:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142387#M39507</guid>
      <dc:creator>carljohan</dc:creator>
      <dc:date>2013-11-14T14:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Index selected events of log file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142388#M39508</link>
      <description>&lt;P&gt;Run a search that pulls the logs listed above, and test the regex like this:&lt;BR /&gt;
  | regex ^ERROR &lt;BR /&gt;
It should only show log entries that start with ERROR.  If it does not, adjust the regex.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2013 14:42:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142388#M39508</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-11-14T14:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Index selected events of log file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142389#M39509</link>
      <description>&lt;P&gt;Mind trying this for REGEX&lt;/P&gt;

&lt;P&gt;"(?m)^ERROR.*"&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2013 17:00:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142389#M39509</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-11-14T17:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Index selected events of log file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142390#M39510</link>
      <description>&lt;P&gt;why not ERROR.+ only?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2013 17:19:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142390#M39510</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2013-11-14T17:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Index selected events of log file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142391#M39511</link>
      <description>&lt;P&gt;I think that your LINE_BREAKER may be causing part of the problem. You should &lt;STRONG&gt;not&lt;/STRONG&gt; need a LINE_BREAKER if you have set SHOULD_LINEMERGE to false&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ESB_Wrapper]
SHOULD_LINEMERGE=false
TIME_FORMAT = %Y/%m/%d %H:%M:%S,%3N
TRANSFORMS-set= setnull,setparsing
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Finally, this REGEX should be sufficient.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = ^ERROR
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You don't need to match the whole event. So a trailing '.*' is unnecessary and more expensive.&lt;/P&gt;

&lt;P&gt;ONE MORE THING:&lt;/P&gt;

&lt;P&gt;Where are your props.conf and transforms.conf? They need to be located where the data is &lt;EM&gt;parsed&lt;/EM&gt; - usually the indexer(s). And, you will need to restart the indexer(s) to make these changes effective. And, your parsing changes are not retroactive - they will only affect new data as it is parsed.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2013 20:06:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-selected-events-of-log-file/m-p/142391#M39511</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-11-14T20:06:05Z</dc:date>
    </item>
  </channel>
</rss>

