<?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 lines in a multiline event in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Index-selected-lines-in-a-multiline-event/m-p/452944#M78459</link>
    <description>&lt;P&gt;@gbv If your problem is resolved, please accept an answer to help future readers.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Mar 2019 12:53:52 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2019-03-28T12:53:52Z</dc:date>
    <item>
      <title>Index selected lines in a multiline event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selected-lines-in-a-multiline-event/m-p/452938#M78453</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Nowadays, we have indexed multiline events and when we search, for example, in a time windows of today, Splunk needs a lot of time. We need to use this information to create a realtime alert, and we need to reduce the time spend searching results.&lt;BR /&gt;
The multiline event has between 150 and 250 lines, but we only need 10 lines, and if we can filter and keep, only these lines we could have a high improvement.&lt;BR /&gt;
The problem is that only the first line has the time, and if we index the events split by line, the events are indexed not in order, because the events write in log very close in time, and we can't know the relationship with each other.&lt;BR /&gt;
Anybody knows any solution to index only the lines that we want in order?&lt;/P&gt;

&lt;P&gt;One example of an event is:&lt;/P&gt;

&lt;P&gt;09:58:12:859                        DATA (82373276236368) = {&lt;BR /&gt;
                                       request: 1111, type: 'x' - [238.11025]-&amp;gt;{ [238.12] [238.28] [238.29]  } (0)&lt;BR /&gt;
                                       userType = 6&lt;BR /&gt;
                                       DataReply (456476567560) = {&lt;BR /&gt;
                                           request: 221212, type: 'x' - [233.10]-&amp;gt;&lt;A href="https://community.splunk.com/0"&gt;233.44&lt;/A&gt;&lt;BR /&gt;
                                           userType = 6 &lt;BR /&gt;
                                           &amp;lt;---------------------------&amp;gt;&lt;BR /&gt;
                                           &amp;lt;---------- REPLY ----------&amp;gt;&lt;BR /&gt;
                                           &amp;lt;---------------------------&amp;gt;&lt;BR /&gt;
                                           Fixed fields = { key : 0 - no : 995 - typeMessage: 88 'O' - classOrder : 'O'&lt;BR /&gt;
                                                        typeReply : 65 'A' - index : 243376 - nbRequestReply : 1&lt;BR /&gt;
                                           }&lt;BR /&gt;
                                           Record (54353453) = {&lt;BR /&gt;
                                               0 (aa) = "VALUE1"&lt;BR /&gt;
                                               1 (bb) = "VALUE2"&lt;BR /&gt;
                                               2 (cc) = "VALUE3"&lt;BR /&gt;
                                               ...&lt;BR /&gt;
                                               51 (abv) = "VALUE4"&lt;BR /&gt;
                                               52 (sdf) = "VALUE5"&lt;BR /&gt;
                                               53 (erf) = "VALUE6"&lt;BR /&gt;
                                               ...&lt;BR /&gt;
                                               240 (wer) = "VALUE7"&lt;BR /&gt;
                                               241 (tyr) = "VALUE8"&lt;BR /&gt;
                                               242 (yhr) = "VALUE9"&lt;BR /&gt;
                                           }&lt;BR /&gt;
                                       }&lt;BR /&gt;
                                       }&lt;/P&gt;

&lt;P&gt;In this example, we only want first line with the hour, the line with request, and lines with codes: 1, 52, 241 and 242.&lt;/P&gt;

&lt;P&gt;We are waiting for any help&lt;BR /&gt;
Thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 09:46:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selected-lines-in-a-multiline-event/m-p/452938#M78453</guid>
      <dc:creator>gbv</dc:creator>
      <dc:date>2019-03-22T09:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Index selected lines in a multiline event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selected-lines-in-a-multiline-event/m-p/452939#M78454</link>
      <description>&lt;P&gt;If you don’t need the full events in Splunk, you should write a script to parse out the lines you need before ingesting into Splunk. This will speed up your search time and greatly reduce your licensing costs. &lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2019 14:30:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selected-lines-in-a-multiline-event/m-p/452939#M78454</guid>
      <dc:creator>ehowardl3</dc:creator>
      <dc:date>2019-03-23T14:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Index selected lines in a multiline event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selected-lines-in-a-multiline-event/m-p/452940#M78455</link>
      <description>&lt;P&gt;Thanks for your answer. The problem here is we need real-time, and if we use a script, we lose that.&lt;BR /&gt;
On the other hand, the source is not ours, so we only can change configuration on indexers.&lt;BR /&gt;
Any suggestions?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 11:36:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selected-lines-in-a-multiline-event/m-p/452940#M78455</guid>
      <dc:creator>gbv</dc:creator>
      <dc:date>2019-03-25T11:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Index selected lines in a multiline event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selected-lines-in-a-multiline-event/m-p/452941#M78456</link>
      <description>&lt;P&gt;Firstly, I would get your event breaking working nicely first - can you share your props? &lt;BR /&gt;
However you probably want to try and use something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;LINE_BREAKER=(^)\d{2}:\d{2}:\d{2}:\d{3}\sDATA
TIME_FORMAT=%H:%M:%S:%N3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should break your events nicely, albeit with all the 250 values.&lt;BR /&gt;
This may improve searching on its own, but lets tackle that separately.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 12:00:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selected-lines-in-a-multiline-event/m-p/452941#M78456</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2019-03-25T12:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Index selected lines in a multiline event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selected-lines-in-a-multiline-event/m-p/452942#M78457</link>
      <description>&lt;P&gt;I am completely unclear what is to be kept and what is to be stripped.  Instead of the ellipses, put the real text back in.  Then clearly mark which lines are to stay and which ones are to be removed.  The real problem here is that you are doing realtime searches.  See here: &lt;A href="https://answers.splunk.com/answers/734767/why-are-realtime-searches-disliked-in-the-splunk-w.html"&gt;https://answers.splunk.com/answers/734767/why-are-realtime-searches-disliked-in-the-splunk-w.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 12:12:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selected-lines-in-a-multiline-event/m-p/452942#M78457</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-25T12:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Index selected lines in a multiline event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selected-lines-in-a-multiline-event/m-p/452943#M78458</link>
      <description>&lt;P&gt;After a period making a lot of test, we find a solution. Instead, we keep only the lines we want, we transform the raw text with the concatenation of fields extracted in these lines. The code in the configuration files is:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;TRANSFORMS.CONF&lt;/STRONG&gt;&lt;BR /&gt;
[change_raw]&lt;BR /&gt;
REGEX = (?:(?:INFO)&lt;EM&gt;\s+)(\d{2}:\d{2}:\d{2}:\d{3}).&lt;/EM&gt;[\n\r]+.&lt;EM&gt;request:\s([^,]+).&lt;/EM&gt;(?:(?:[\n\r]+.&lt;EM&gt;?)+(1\s&lt;/EM&gt;(bb)\s=\s\"\w+\")+)?(?:(?:[\n\r]+.&lt;EM&gt;?)+(52\s&lt;/EM&gt;(sdf)\s=\s\"?\w+\"?)+)?(?:(?:[\n\r]+.&lt;EM&gt;?)+(241\s&lt;/EM&gt;(tyr)\s=\s\"[^\"]+\")+)?(?:(?:[\n\r]+.&lt;EM&gt;?)+(242\s&lt;/EM&gt;(yhr)\s=\s\"\w+\")+)?(?:(?:[\n\r]+.*?)+)?&lt;BR /&gt;
DEST_KEY = _raw&lt;BR /&gt;
LOOKAHEAD = 100000&lt;BR /&gt;
MATCH_LIMIT = 1000000&lt;BR /&gt;
FORMAT = $1 request: $2 $3 $4 $5 $6&lt;BR /&gt;
WRITE_META = true&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;PROPS.CONF&lt;/STRONG&gt;&lt;BR /&gt;
[&lt;EM&gt;sourcetype&lt;/EM&gt;]&lt;BR /&gt;
BREAK_ONLY_BEFORE = ^\w*\s+\d+:\d+:\d+:\d+\s+\w+\s+(\d+x[^)]+)\s+=\s+{&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 12&lt;BR /&gt;
NO_BINARY_CHECK = true&lt;BR /&gt;
SHOULD_LINEMERGE = true&lt;BR /&gt;
TIME_FORMAT = %H:%M:%S:%3N&lt;BR /&gt;
TRUNCATE = 0&lt;BR /&gt;
MAX_EVENTS = 512&lt;BR /&gt;
TIME_PREFIX = ^\w*\s+&lt;BR /&gt;
DATETIME_CONFIG =&lt;BR /&gt;
disabled = false&lt;BR /&gt;
pulldown_type = true&lt;BR /&gt;
TRANSFORMS-filtro = change_raw&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:53:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selected-lines-in-a-multiline-event/m-p/452943#M78458</guid>
      <dc:creator>gbv</dc:creator>
      <dc:date>2020-09-29T23:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Index selected lines in a multiline event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Index-selected-lines-in-a-multiline-event/m-p/452944#M78459</link>
      <description>&lt;P&gt;@gbv If your problem is resolved, please accept an answer to help future readers.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 12:53:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Index-selected-lines-in-a-multiline-event/m-p/452944#M78459</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-03-28T12:53:52Z</dc:date>
    </item>
  </channel>
</rss>

