<?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: Break events based on a string in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453932#M172340</link>
    <description>&lt;P&gt;Won't this configuration cut the &lt;EM&gt;SNMPv2-SMI::enterprises&lt;/EM&gt; part out of the event? I don't know if this is intended. Thats why I included this in a non-capturing group in my example. &lt;/P&gt;

&lt;P&gt;But apart from that you are correct, if data comes in via UF, you should always inclund EVENT_BREAKER config!&lt;/P&gt;</description>
    <pubDate>Mon, 25 Mar 2019 07:14:02 GMT</pubDate>
    <dc:creator>DMohn</dc:creator>
    <dc:date>2019-03-25T07:14:02Z</dc:date>
    <item>
      <title>Break events based on a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453926#M172334</link>
      <description>&lt;P&gt;hi ,&lt;/P&gt;

&lt;P&gt;Below is my single event indexing into splunk.I want to break the events into single events .It should break and comes into the next row after the string "SNMPv2- SMI::enterprises" .i got stuck writing regex on this . Kindly help.&lt;/P&gt;

&lt;P&gt;SNMPv2-SMI::enterprises."2011.2.281.2.1.20008.41032.1044.1.1.26.33555088.41025.22017.41032.29825" = "0" SNMPv2-SMI::enterprises."2011.2.281.2.1.20008.41032.1044.1.1.26.33555088.41025.22017.41032.29865" = "0" SNMPv2-SMI::enterprises."2011.2.281.2.1.20008.41032.1044.1.1.26.33555088.41025.22018.41032.29826" = "0" SNMPv2-SMI::enterprises."2011.2.281.2.1.20008.41032.1044.1.1.26.33555088.41025.22018.41032.29863" = "0" SNMPv2-SMI&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 13:11:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453926#M172334</guid>
      <dc:creator>Nadhiyaa</dc:creator>
      <dc:date>2019-03-21T13:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Break events based on a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453927#M172335</link>
      <description>&lt;P&gt;In your props.conf, can you try with &lt;CODE&gt;MUST_BREAK_AFTER=([\r\n]+)(?=SNMPv2- SMI::enterprises)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Also, send your props.conf&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 13:20:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453927#M172335</guid>
      <dc:creator>lakshman239</dc:creator>
      <dc:date>2019-03-21T13:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Break events based on a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453928#M172336</link>
      <description>&lt;P&gt;Add the following line to your appropriate props.conf stanza:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
LINE_BREAKER = (?:SNMPv2-SMI::enterprises)(.)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It is always encouraged to use the LINE_BREAKER stanza where possible. THis will take (at least) one RegEx capturing group, which marks the &lt;EM&gt;end&lt;/EM&gt; of one event &lt;STRONG&gt;and will be discarded&lt;/STRONG&gt;. So in your case, as the end of your events is represented by the string "SNMPv2-SMI::enterprises" this needs to come before the end-of-event-group and hence is a non-capturing group. The single charakter thereafter is being discarded, and the next event starts right after.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 15:10:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453928#M172336</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-03-21T15:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Break events based on a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453929#M172337</link>
      <description>&lt;P&gt;Hi ,@DMohn &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/177803"&gt;@lakshman239&lt;/a&gt; &lt;BR /&gt;
Below props.conf worked when i added the data manually .but not working when specified in the heavy forwarder .Tried specified in both indexer and search head as well. Please help what could be the issue .&lt;/P&gt;

&lt;P&gt;[sourcetype]&lt;BR /&gt;
BREAK_ONLY_BEFORE = ([\s]+)(?=SNMPv2-SMI::enterprises)&lt;BR /&gt;
DATETIME_CONFIG =&lt;BR /&gt;
LINE_BREAKER = ([\s]+)(?=SNMPv2-SMI::enterprises)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:48:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453929#M172337</guid>
      <dc:creator>Nadhiyaa</dc:creator>
      <dc:date>2020-09-29T23:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Break events based on a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453930#M172338</link>
      <description>&lt;P&gt;Google &lt;CODE&gt;Splunk Magic 6&lt;/CODE&gt; or &lt;CODE&gt;Splunk Magic 8&lt;/CODE&gt; and read up on how bad it is to let Splunk merge events and guess at timestamps.  You need EXACTLY these settings in props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yourSourcetypeHere]
SHOULD_LINEMERGE = false
#LINE_BREAKER = ([\n\r\s]*)SNMPv2-SMI::enterprises\.
LINE_BREAKER = ([\n\r\s]*SNMPv2-SMI::enterprises\.)
#EVENT_BREAKER = ([\n\r\s]*)SNMPv2-SMI::enterprises\.
EVENT_BREAKER = ([\n\r\s]*SNMPv2-SMI::enterprises\.)
EVENT_BREAKER_ENABLE = true
DATETIME_CONFIG = CURRENT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can save license by stripping off the &lt;CODE&gt;SNMPv2-SMI::enterprises.&lt;/CODE&gt; or you can keep it.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2019 13:03:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453930#M172338</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-24T13:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Break events based on a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453931#M172339</link>
      <description>&lt;P&gt;This is a very poor configuration, if it even works.  Do not use this.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2019 13:04:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453931#M172339</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-24T13:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Break events based on a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453932#M172340</link>
      <description>&lt;P&gt;Won't this configuration cut the &lt;EM&gt;SNMPv2-SMI::enterprises&lt;/EM&gt; part out of the event? I don't know if this is intended. Thats why I included this in a non-capturing group in my example. &lt;/P&gt;

&lt;P&gt;But apart from that you are correct, if data comes in via UF, you should always inclund EVENT_BREAKER config!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 07:14:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453932#M172340</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-03-25T07:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: Break events based on a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453933#M172341</link>
      <description>&lt;P&gt;@woodcock &lt;/P&gt;

&lt;P&gt;above props.conf works when we manually add the data .&lt;BR /&gt;
As we are getting the snmp data via our heavy forwarder somehow its not taking the props.conf and its not working. Specified the props in search head and indexers as well but none worked .&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 09:36:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453933#M172341</guid>
      <dc:creator>Nadhiyaa</dc:creator>
      <dc:date>2019-03-25T09:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Break events based on a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453934#M172342</link>
      <description>&lt;P&gt;It must be deployed to the HFs, not the Indexers.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 10:14:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453934#M172342</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-25T10:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: Break events based on a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453935#M172343</link>
      <description>&lt;P&gt;Swap for the one that is commented out.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 10:19:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453935#M172343</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-25T10:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Break events based on a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453936#M172344</link>
      <description>&lt;P&gt;yes, we have deployed it on the HF, but still it is not working ? Can you further advise on this issue ?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 05:30:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453936#M172344</guid>
      <dc:creator>pgadhari</dc:creator>
      <dc:date>2019-03-26T05:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Break events based on a string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453937#M172345</link>
      <description>&lt;P&gt;@DMohn - If you see the logs properly, the event starts with &lt;STRONG&gt;"SNMPv2-SMI::enterprises"&lt;/STRONG&gt;, and ends with third &lt;STRONG&gt;"space"&lt;/STRONG&gt;, in between there are 2 spaces.&lt;/P&gt;

&lt;P&gt;e.g :&lt;/P&gt;

&lt;P&gt;SNMPv2-SMI::enterprises."2011.2.281.2.1.20008.41032.1044.1.1.26.33555088.41025.22017.41032.29825" = "0" &lt;BR /&gt;
so ideally, we need to break at the last &lt;STRONG&gt;"Space"&lt;/STRONG&gt; of that event i.e. third space. I have attached the image for the event and marked the space with red where line break should occur. &lt;/P&gt;

&lt;P&gt;&lt;A href="https://ibb.co/cCqSsXg"&gt;https://ibb.co/cCqSsXg&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;How do we write the capture regex for that ? &lt;/P&gt;

&lt;P&gt;Strange behaviour is when we export sample raw logs and upload from local manually, the suggested regex works. But when we put that on HF, it does not works. We are restarting splunk after the change on HF.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2019 11:29:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Break-events-based-on-a-string/m-p/453937#M172345</guid>
      <dc:creator>pgadhari</dc:creator>
      <dc:date>2019-03-26T11:29:12Z</dc:date>
    </item>
  </channel>
</rss>

