<?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: Log merging in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414314#M73280</link>
    <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[jsonCicd]
SHOULD_LINEMERGE =false
LINE_BREAKER = }}([\r\n\s]*){\"log\":\"
TIME_PREFIX = \"time\":\"
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%N%Z
MAX_TIMESTAMP_LOOKAHEAD = 32
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 14 Apr 2019 06:31:22 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-04-14T06:31:22Z</dc:date>
    <item>
      <title>Log merging</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414312#M73278</link>
      <description>&lt;P&gt;Hello, I am trying to merge two lines logs, but no luck with it&lt;BR /&gt;
Splunk Enterprise 7.1.2&lt;/P&gt;

&lt;P&gt;here is sample&lt;BR /&gt;
{"log":"Apr 04, 2019 12:01:24 PM hudson.model.AsyncPeriodicWork$1 run\n", "stream":"stderr", "time":"2019-04-04T12:01:24.77173976Z", "kubernetes":{"pod_name":"jenkins-bdd89884d-4v6sd", "namespace_name":"001", "pod_id":"33c4a5bd-553a-11e9-8b8e-005056aea3a7", "labels":{"app":"jenkins", "pod-template-hash":"688454408"}, "host":"001", "container_name":"jenkins", "docker_id":"aa9ab26e108daf221b974d80ddf1e51d91b6b235698a4f4711a0313231649a10"}}&lt;BR /&gt;
{"log":"INFO: Finished DockerContainerWatchdog Asynchronous Periodic Work. 2 ms\n", "stream":"stderr", "time":"2019-04-04T12:01:24.771743784Z", "kubernetes":{"pod_name":"jenkins-bdd89884d-4v6sd", "namespace_name":"001", "pod_id":"33c4a5bd-553a-11e9-8b8e-005056aea3a7", "labels":{"app":"jenkins", "pod-template-hash":"688454408"}, "host":"001", "container_name":"jenkins", "docker_id":"aa9ab26e108daf221b974d80ddf1e51d91b6b235698a4f4711a0313231649a10"}}&lt;/P&gt;

&lt;P&gt;i have created regex that works well with sample log in Add Data, but not in "real world". it is matching {"log":" at the begging of the log and then date.&lt;/P&gt;

&lt;P&gt;this is my local props.conf&lt;BR /&gt;
[jsonCicd]&lt;BR /&gt;
BREAK_ONLY_BEFORE = ^({\"log\":\")([A-Za-z]+)\s([0-9]+),\s([0-9]+)\s([0-9]+):([0-9]+):([0-9]+)\s([A,PM])&lt;BR /&gt;
DATETIME_CONFIG =&lt;BR /&gt;
NO_BINARY_CHECK = true&lt;BR /&gt;
category = Structured&lt;BR /&gt;
description = cicd logs merging&lt;BR /&gt;
pulldown_type = true&lt;/P&gt;

&lt;P&gt;particular input has this sourcetype set&lt;/P&gt;

&lt;P&gt;here is debug log&lt;/P&gt;

&lt;P&gt;04-12-2019 08:46:25.086 +0000 DEBUG PropertiesMapConfig - Pattern 'jsonCicd' matches with priority 100&lt;BR /&gt;
04-12-2019 08:46:25.086 +0000 DEBUG UTF8Processor - Done key received for: source::http:cicd|host::001:8088|jsonCicd|&lt;BR /&gt;
04-12-2019 08:46:25.086 +0000 DEBUG UTF8Processor - Done key received for: source::http:cicd|host::001:8088|jsonCicd|&lt;BR /&gt;
04-12-2019 08:46:25.086 +0000 DEBUG UTF8Processor - Done key received for: source::http:cicd|host::001:8088|jsonCicd|&lt;BR /&gt;
04-12-2019 08:46:25.086 +0000 DEBUG UTF8Processor - Done key received for: source::http:cicd|host::001:8088|jsonCicd|&lt;BR /&gt;
04-12-2019 08:46:25.086 +0000 INFO  AggregatorMiningProcessor - Setting up line merging apparatus for: source::http:cicd|host::001:8088|jsonCicd|&lt;/P&gt;

&lt;P&gt;which looks fine for me. I have tried multiple combinations, for example with time format etc, but result is still the same.&lt;BR /&gt;
any ideas why I still can see two logs in search app, please?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:08:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414312#M73278</guid>
      <dc:creator>pgelnar_hci</dc:creator>
      <dc:date>2020-09-30T00:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Log merging</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414313#M73279</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[jsonCicd]
SHOULD_LINEMERGE =false
LINE_BREAKER =([\r\n]+)(?=\{\"log\"\:\"\w+\s+\d+,\s+\d+)
TIME_PREFIX = \"time\":\"
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%N%Z
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Apr 2019 16:42:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414313#M73279</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-04-12T16:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Log merging</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414314#M73280</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[jsonCicd]
SHOULD_LINEMERGE =false
LINE_BREAKER = }}([\r\n\s]*){\"log\":\"
TIME_PREFIX = \"time\":\"
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%N%Z
MAX_TIMESTAMP_LOOKAHEAD = 32
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 Apr 2019 06:31:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414314#M73280</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-14T06:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Log merging</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414315#M73281</link>
      <description>&lt;P&gt;Thank you to both of you, but none of these are working unfortunatelly. any other ideas, please?&lt;BR /&gt;
DEBUG log looks still the same&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 14:02:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414315#M73281</guid>
      <dc:creator>pgelnar_hci</dc:creator>
      <dc:date>2019-04-15T14:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Log merging</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414316#M73282</link>
      <description>&lt;P&gt;I suspect that you are wrong.  You must do ALL of the following:&lt;BR /&gt;
0: Ensure that &lt;CODE&gt;jsonCicd&lt;/CODE&gt; is the ORIGINAL sourcetype of the events (if you did sourcetype override/overwrite, you must use the PREVIOUS value).&lt;BR /&gt;
1: Deploy this configuration to the first FULL instance of Splunk that handles the events (usually Indexers but might be a Heavy Forwarder).&lt;BR /&gt;
2: Restart All Splunk instances there.&lt;BR /&gt;
3: Send new events into Splunk.&lt;BR /&gt;
4: Search ONLY the new events (older events will stay broken); to ensure this BE SURE to use &lt;CODE&gt;_index_earliest=-5m&lt;/CODE&gt; to your search SPL string.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 19:49:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414316#M73282</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-15T19:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Log merging</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414317#M73283</link>
      <description>&lt;P&gt;Thank you, @woodcock &lt;BR /&gt;
0 - Not really sure, what do you mean by that. If you mean that this sourcetype was used from beggining of logging of Jenkins, then no, I used different one. I also tried to point logs with new sourcetype to another index.&lt;BR /&gt;
1 - It is the only instance of Splunk, not separated indexer from search head &lt;BR /&gt;
2 - Done after every attempt&lt;BR /&gt;
3 - Receiving&lt;BR /&gt;
4 - Looking at newest events, still the same&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2019 07:21:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414317#M73283</guid>
      <dc:creator>pgelnar_hci</dc:creator>
      <dc:date>2019-04-16T07:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Log merging</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414318#M73284</link>
      <description>&lt;P&gt;For &lt;CODE&gt;0&lt;/CODE&gt; are you doing this? &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Data/Advancedsourcetypeoverrides"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Data/Advancedsourcetypeoverrides&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2019 12:06:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414318#M73284</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-16T12:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Log merging</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414319#M73285</link>
      <description>&lt;P&gt;Thank you, as  I understood from documentation, I tried this&lt;/P&gt;

&lt;P&gt;/system/local/transforms.conf&lt;BR /&gt;
[jsonCicd]&lt;BR /&gt;
REGEX = ^({\"log\":\")([A-Za-z]+)\s([0-9]+),\s([0-9]+)\s([0-9]+):([0-9]+):([0-9]+)\s([A,PM])&lt;BR /&gt;
FORMAT = sourcetype::jsonCicd&lt;BR /&gt;
DEST_KEY = MetaData:Sourcetype&lt;/P&gt;

&lt;P&gt;and according your advice:&lt;/P&gt;

&lt;P&gt;/system/local/props.conf&lt;BR /&gt;
[jsonCicd]&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;BR /&gt;
LINE_BREAKER = }}([\r\n\s]*){\"log\":\"&lt;BR /&gt;
TIME_PREFIX = \"time\":\"&lt;BR /&gt;
TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%N%Z&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 32&lt;/P&gt;

&lt;P&gt;is that correct? i suppose not, because not working either...&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:11:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414319#M73285</guid>
      <dc:creator>pgelnar_hci</dc:creator>
      <dc:date>2020-09-30T00:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Log merging</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414320#M73286</link>
      <description>&lt;P&gt;No.  You do not need the transforms.conf stuff at all.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 18:58:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414320#M73286</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-18T18:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Log merging</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414321#M73287</link>
      <description>&lt;P&gt;It seems that I am stuck with HEC, here is answer, that I got from official Splunk Support:&lt;/P&gt;

&lt;P&gt;I you need to use HEC, events need to be contained in one request:&lt;BR /&gt;
"Events must be contained within a single HTTP request. They cannot span multiple requests."&lt;BR /&gt;
as explained in the official documentation:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.5/Data/FormateventsforHTTPEventCollector#Raw_event_parsing"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.5/Data/FormateventsforHTTPEventCollector#Raw_event_parsing&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I'll try if it's possible to use TCP input for these logs. I will let this issue opened for updates.&lt;/P&gt;

&lt;P&gt;Thank you for your help&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 11:43:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-merging/m-p/414321#M73287</guid>
      <dc:creator>pgelnar_hci</dc:creator>
      <dc:date>2019-04-24T11:43:30Z</dc:date>
    </item>
  </channel>
</rss>

