<?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 only events matching with pattern and exclude everyting else in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Index-only-events-matching-with-pattern-and-exclude-everyting/m-p/520085#M3463</link>
    <description>&lt;P&gt;props.conf&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[mx_java_event]
TRANSFORMS-set = setnull, setparsing&lt;/LI-CODE&gt;&lt;P&gt;transforms.conf&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE:&amp;nbsp; if event contains "Session initialization" OR "Session initialized" anywhere then the event will be indexed others are ignored.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[setparsing]
REGEX = (Session initialization|Session initialized)
DEST_KEY = queue
FORMAT = indexQueue&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;below is output from your sample events:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filter-events.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/10869iF012BE421C1589B2/image-size/large?v=v2&amp;amp;px=999" role="button" title="filter-events.png" alt="filter-events.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Sep 2020 08:53:40 GMT</pubDate>
    <dc:creator>thambisetty</dc:creator>
    <dc:date>2020-09-17T08:53:40Z</dc:date>
    <item>
      <title>Index only events matching with pattern and exclude everyting else</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Index-only-events-matching-with-pattern-and-exclude-everyting/m-p/519961#M3452</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;In particular sourcetype we are getting huge numbers of events but only some data events are relevant. I am try to take only events with matching string and exclude everything else.&lt;/P&gt;&lt;P&gt;Matching strings :&amp;nbsp; Session initialization | Session initialized&amp;nbsp; &amp;nbsp;(There are few more as well)&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have tried this by refereing this post&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Getting-Data-In/How-do-i-exclude-some-events-from-being-indexed-by-Splunk/m-p/9213/thread-id/18" target="_self"&gt;Link&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;When I am using this its excluding everyting and when i tried only with setparsing its injesting all data. Not sure what I am missing here.&lt;BR /&gt;&lt;BR /&gt;props.conf&lt;/P&gt;&lt;P&gt;[mx_java_event]&lt;BR /&gt;DATETIME_CONFIG =&lt;BR /&gt;LINE_BREAKER = ([\r\n]+)&lt;BR /&gt;NO_BINARY_CHECK = true&lt;BR /&gt;category = Custom&lt;BR /&gt;pulldown_type = true&lt;BR /&gt;EXTRACT-JavaClass = ,\d+\s\[(?&amp;lt;JavaClass&amp;gt;[^:]*):&lt;BR /&gt;EXTRACT-Session = session:(?&amp;lt;Session&amp;gt;\d+)&lt;BR /&gt;&lt;STRONG&gt;TRANSFORMS-set = setnull, setparsing&lt;BR /&gt;&lt;BR /&gt;transforms.conf&lt;/STRONG&gt;&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 = Session initialization | Session initialized&lt;BR /&gt;DEST_KEY = queue&lt;BR /&gt;FORMAT = indexQueue&lt;/P&gt;&lt;P&gt;FYI : In case REGEX is incorrect, I tried with "REGEX = Session"&amp;nbsp; its not working either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample data: (Only 1st and 3rd line are matching)&lt;BR /&gt;&lt;BR /&gt;2020-08-12 14:08:11,775 [Thread-233 - Worker-54] murex.processing.stp.osp.server.service.OspServer : DEBUG - [session:1758555252] Session initialization - SGITOPS/SG_LAW_MRC&lt;BR /&gt;2020-08-12 14:08:12,775 [Thread-233 - Worker-54] murex.processing.stp.osp.server.service.OspServer : DEBUG - [session:1758555252] Excluded - SGITOPS/SG_LAW_MRC&lt;BR /&gt;2020-08-12 14:08:11,912 [Thread-233 - Worker-54] murex.processing.stp.osp.server.service.OspServer : DEBUG - [session:1758555252] Session initialized&lt;BR /&gt;2020-08-12 14:08:12,912 [Thread-233 - Worker-54] murex.processing.stp.osp.server.service.OspServer : DEBUG - [session:1758555252] Session Excluded2&lt;BR /&gt;2020-08-12 14:08:12,912 JUST FOR Testing&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 16:17:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Index-only-events-matching-with-pattern-and-exclude-everyting/m-p/519961#M3452</guid>
      <dc:creator>AKG1_old1</dc:creator>
      <dc:date>2020-09-16T16:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Index only events matching with pattern and exclude everyting else</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Index-only-events-matching-with-pattern-and-exclude-everyting/m-p/519975#M3453</link>
      <description>&lt;P&gt;Provide sample events to test regex.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 16:12:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Index-only-events-matching-with-pattern-and-exclude-everyting/m-p/519975#M3453</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-16T16:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Index only events matching with pattern and exclude everyting else</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Index-only-events-matching-with-pattern-and-exclude-everyting/m-p/519976#M3454</link>
      <description>&lt;P&gt;added sample data&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 16:18:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Index-only-events-matching-with-pattern-and-exclude-everyting/m-p/519976#M3454</guid>
      <dc:creator>AKG1_old1</dc:creator>
      <dc:date>2020-09-16T16:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Index only events matching with pattern and exclude everyting else</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Index-only-events-matching-with-pattern-and-exclude-everyting/m-p/520085#M3463</link>
      <description>&lt;P&gt;props.conf&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[mx_java_event]
TRANSFORMS-set = setnull, setparsing&lt;/LI-CODE&gt;&lt;P&gt;transforms.conf&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE:&amp;nbsp; if event contains "Session initialization" OR "Session initialized" anywhere then the event will be indexed others are ignored.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[setparsing]
REGEX = (Session initialization|Session initialized)
DEST_KEY = queue
FORMAT = indexQueue&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;below is output from your sample events:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filter-events.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/10869iF012BE421C1589B2/image-size/large?v=v2&amp;amp;px=999" role="button" title="filter-events.png" alt="filter-events.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 08:53:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Index-only-events-matching-with-pattern-and-exclude-everyting/m-p/520085#M3463</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-17T08:53:40Z</dc:date>
    </item>
  </channel>
</rss>

