<?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: Setting Source Type for Log file with some Multi Line data in between lines with TimeStamp in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Setting-Source-Type-for-Log-file-with-some-Multi-Line-data-in/m-p/423884#M74437</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/180689"&gt;@dowdag&lt;/a&gt; ,&lt;BR /&gt;
You'll first need to configure your sourcetype to break events properly.&lt;BR /&gt;
You should be using the following in your props.conf:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
[&amp;lt;Your sourcetypename&amp;gt;]&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;BR /&gt;
LINE_BREAKER = ([\r\n]+)\d\d\d\d-\d\d-\d\d&lt;BR /&gt;
TIME_PREFIX = ^&lt;BR /&gt;
TIME_FORMAT = %Y-%m-%d %H:%M:%S.%3N&lt;BR /&gt;
&lt;/PRE&gt;&lt;BR /&gt;
This will ensure that your event breaks only happen after a line break that is followed by a XXXX-XX-XX year-month-day value. &lt;BR /&gt;
Once you have that fixed, you'll be able to extract the field values for the data you're looking for by using a simple extract in props.conf for your sourcetype:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
[&amp;lt;Your sourcetypename&amp;gt;]&lt;BR /&gt;
EXTRACT-transaction_and_payment_info = TransactionId=(?&amp;lt;TransactionId&amp;gt;[a-fA-F0-9-]+)[\S\s]+PaymentId=(?&amp;lt;PaymentId&amp;gt;[^,]+),&lt;/PRE&gt;&lt;BR /&gt;
Although, if KV Mode is set to AUTO, once you fix the line breaking issue, your fields might be associated properly anyway.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 00:56:30 GMT</pubDate>
    <dc:creator>jnudell_2</dc:creator>
    <dc:date>2020-09-30T00:56:30Z</dc:date>
    <item>
      <title>Setting Source Type for Log file with some Multi Line data in between lines with TimeStamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Setting-Source-Type-for-Log-file-with-some-Multi-Line-data-in/m-p/423881#M74434</link>
      <description>&lt;P&gt;I have a log file that is formatted like: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2019-06-06 11:10:09,029  some event
2019-06-06 11:10:10,029 ............  - Enqueuing interaction, PayCommand
TransactionInfo=[Command=Pay, TransactionId=9081161e-41d8-46ae-953b-df659c038da2
            CmdInfo=[TerminalId=1, OriginalTerminal=|null|, TableId=1048589, CheckId=1048589, CustomCommand=|null|, ScreenType=NotSet]
            PaymentInfo=[PaymentId=1048590, .............]
2019-06-06 11:12:12,00  next event
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;TimeStamp data&lt;BR /&gt;
Data -- no timestamp&lt;BR /&gt;
Data -- no timestamp&lt;BR /&gt;
Data -- no timestamp&lt;BR /&gt;
(Next) TimeStamp&lt;/P&gt;

&lt;P&gt;How to set my Source Type correctly so that I can extract TransactionId GUID and PaymentId&lt;BR /&gt;
Very confused here... thanks for any help!&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2019 00:04:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Setting-Source-Type-for-Log-file-with-some-Multi-Line-data-in/m-p/423881#M74434</guid>
      <dc:creator>dowdag</dc:creator>
      <dc:date>2019-06-15T00:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Source Type for Log file with some Multi Line data in between lines with TimeStamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Setting-Source-Type-for-Log-file-with-some-Multi-Line-data-in/m-p/423882#M74435</link>
      <description>&lt;P&gt;Hi dowdag,&lt;BR /&gt;
let me understand: your event starts with timestamp, the other rows are in the same event, correct?&lt;BR /&gt;
In other words, your event: is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2019-06-06 11:10:10,029 ............  - Enqueuing interaction, PayCommand
 TransactionInfo=[Command=Pay, TransactionId=9081161e-41d8-46ae-953b-df659c038da2
             CmdInfo=[TerminalId=1, OriginalTerminal=|null|, TableId=1048589, CheckId=1048589, CustomCommand=|null|, ScreenType=NotSet]
             PaymentInfo=[PaymentId=1048590, .............]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Correct?&lt;BR /&gt;
This is a very standard log so you shouldn't have problems in ingestion, anyway try something like this in props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_sourcetype]
SOULD_LINEMERGE = True
TIME_PREFIX = ^
TIME_FORMAT = %Y-%m-%d %H:%M:%S.%3N
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;TIME_PREFIX and TIME_FORMAT aren't mandatory but I prefer to use them&lt;/P&gt;

&lt;P&gt;To extract TransactionId and PaymentId at search time, you can use rex command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "TransactionId\=(?P&amp;lt;TransactionId&amp;gt;[^ ]*).*\s+.*PaymentId\=(?P&amp;lt;PaymentId&amp;gt;[^,]*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or put this regex in a filed extraction.&lt;BR /&gt;
You can test it at &lt;A href="https://regex101.com/r/IlOFp2/1" target="_blank"&gt;https://regex101.com/r/IlOFp2/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:55:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Setting-Source-Type-for-Log-file-with-some-Multi-Line-data-in/m-p/423882#M74435</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-30T00:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Source Type for Log file with some Multi Line data in between lines with TimeStamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Setting-Source-Type-for-Log-file-with-some-Multi-Line-data-in/m-p/423883#M74436</link>
      <description>&lt;P&gt;You'll also need this line in your props.conf:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;BREAK_ONLY_BEFORE_DATE = true&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;BTW, &lt;CODE&gt;SOULD_LINEMERGE&lt;/CODE&gt;, should be &lt;CODE&gt;SHOULD_LINEMERGE&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2019 12:22:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Setting-Source-Type-for-Log-file-with-some-Multi-Line-data-in/m-p/423883#M74436</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-06-15T12:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Source Type for Log file with some Multi Line data in between lines with TimeStamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Setting-Source-Type-for-Log-file-with-some-Multi-Line-data-in/m-p/423884#M74437</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/180689"&gt;@dowdag&lt;/a&gt; ,&lt;BR /&gt;
You'll first need to configure your sourcetype to break events properly.&lt;BR /&gt;
You should be using the following in your props.conf:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
[&amp;lt;Your sourcetypename&amp;gt;]&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;BR /&gt;
LINE_BREAKER = ([\r\n]+)\d\d\d\d-\d\d-\d\d&lt;BR /&gt;
TIME_PREFIX = ^&lt;BR /&gt;
TIME_FORMAT = %Y-%m-%d %H:%M:%S.%3N&lt;BR /&gt;
&lt;/PRE&gt;&lt;BR /&gt;
This will ensure that your event breaks only happen after a line break that is followed by a XXXX-XX-XX year-month-day value. &lt;BR /&gt;
Once you have that fixed, you'll be able to extract the field values for the data you're looking for by using a simple extract in props.conf for your sourcetype:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
[&amp;lt;Your sourcetypename&amp;gt;]&lt;BR /&gt;
EXTRACT-transaction_and_payment_info = TransactionId=(?&amp;lt;TransactionId&amp;gt;[a-fA-F0-9-]+)[\S\s]+PaymentId=(?&amp;lt;PaymentId&amp;gt;[^,]+),&lt;/PRE&gt;&lt;BR /&gt;
Although, if KV Mode is set to AUTO, once you fix the line breaking issue, your fields might be associated properly anyway.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:56:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Setting-Source-Type-for-Log-file-with-some-Multi-Line-data-in/m-p/423884#M74437</guid>
      <dc:creator>jnudell_2</dc:creator>
      <dc:date>2020-09-30T00:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Source Type for Log file with some Multi Line data in between lines with TimeStamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Setting-Source-Type-for-Log-file-with-some-Multi-Line-data-in/m-p/423885#M74438</link>
      <description>&lt;P&gt;re: MultiLine field extract not working...&lt;/P&gt;

&lt;P&gt;Thanks for suggestion -- I do not want to edit the props.config - I just want to effect one of my source types.&lt;BR /&gt;
Not matter what I try I can not get multi line field extraction to work with splunk free. I am reading through the documentation and  not understanding how this feature works....&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/Data/Configureeventlinebreaking" target="test_blank"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/Data/Configureeventlinebreaking&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Jun 2019 17:30:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Setting-Source-Type-for-Log-file-with-some-Multi-Line-data-in/m-p/423885#M74438</guid>
      <dc:creator>dowdag</dc:creator>
      <dc:date>2019-06-17T17:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Source Type for Log file with some Multi Line data in between lines with TimeStamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Setting-Source-Type-for-Log-file-with-some-Multi-Line-data-in/m-p/423886#M74439</link>
      <description>&lt;P&gt;That's because the document you're referring to is telling you to make changes to props.conf, like I suggested.&lt;/P&gt;

&lt;P&gt;You're not talking about multi-line field extraction.  You're talking about multi-event field extraction, because your events are not created properly at index time.  In order to &lt;EM&gt;NOT&lt;/EM&gt; change the event breaking &lt;EM&gt;AND&lt;/EM&gt; extract fields across multiple events, you would have to group them in the same transaction somehow, and then extract the fields from that transaction.&lt;/P&gt;

&lt;P&gt;I don't recommend doing it this way, because it's trying to get around the fact that the events are not properly created in the first place.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 17:40:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Setting-Source-Type-for-Log-file-with-some-Multi-Line-data-in/m-p/423886#M74439</guid>
      <dc:creator>jnudell_2</dc:creator>
      <dc:date>2019-06-17T17:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Source Type for Log file with some Multi Line data in between lines with TimeStamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Setting-Source-Type-for-Log-file-with-some-Multi-Line-data-in/m-p/423887#M74440</link>
      <description>&lt;P&gt;Use this on your HF or Indexer tier inside props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[my_sourcetype]
SHOULD_LINEMERGE = false
LINE_BREAKER = ([\r\n]+)\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}
TIME_PREFIX = ^
TIME_FORMAT = %Y-%m-%d %H:%M:%S,%3N
EXTRACT-my_sourcetype_ids = "(?ms)TransactionId=(?&amp;lt;TransactionId&amp;gt;\S+).*?PaymentId=(?&amp;lt;PaymentId&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you are doing sourcetype override/overwrite, then USE THE ORIGINAL SOURCETYPE, deploy to the first full instance of Splunk that handles the events (usually HF or Indexer tier), restart all Splunk instances there, send in NEW events (old events will stay broken forever) and ensure that your test search is seeing new events by adding &lt;CODE&gt;_index_earliest = -5m&lt;/CODE&gt; to your search.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 21:07:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Setting-Source-Type-for-Log-file-with-some-Multi-Line-data-in/m-p/423887#M74440</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-06-17T21:07:12Z</dc:date>
    </item>
  </channel>
</rss>

