<?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 Issue to manage single event with Splunk input data script. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Issue-to-manage-single-event-with-Splunk-input-data-script/m-p/39896#M7422</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I connect a bat script as input data to my Splunk instance.&lt;BR /&gt;
This script reads a folder of websphere log files, for each websphere log file, it processes &lt;BR /&gt;
a conversion of TIMESTAMP: French TIMESTAMP (with accents) to 'Standard' TIMESTAMP.&lt;BR /&gt;
e.g.: event converted:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[03/01/2011 08:01:37 AM]Servlet.Engine.Transports : 8730 [error] HTTP0402E Invalid Request
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The script display all converted events on the STDOUT.&lt;BR /&gt;
My issue is that Splunk manage all events from one file as only one multi-line event.(so, I get as many events than file number.)&lt;/P&gt;

&lt;P&gt;e.g.: &lt;BR /&gt;
script stdout for 1 file read:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[12/13/2010 07:13:56 AM] 140.94.3.120 "GET /home.jsp HTTP/1.1" 200 -
[03/01/2011 08:01:37 AM]Servlet.Engine.Transports : 8730 [error] HTTP0402E Invalid Request 1
[03/05/2011 08:59:08 AM]Servlet.Engine.Transports : 9179 [error] HTTP0402E Invalid Request 1
[03/10/2011 09:06:46 AM]Servlet.Engine.Transports : 9243 [error] HTTP0402E Invalid Request 1
[03/15/2011 07:15:00 AM] 140.94.3.120 "GET /home.jsp HTTP/1.1" 200 -
[03/20/2011 07:15:03 AM] 140.94.2.182 "HEAD /home.jsp HTTP/1.1" 200 -
[04/01/2011 08:01:37 AM]Servlet.Engine.Transports : 8730 [error] HTTP0402E Invalid Request 1
[04/05/2011 08:59:08 AM]Servlet.Engine.Transports : 9179 [error] HTTP0402E Invalid Request 1
[04/10/2011 09:06:46 AM]Servlet.Engine.Transports : 9243 [error] HTTP0402E Invalid Request
[04/15/2011 07:15:00 AM] 140.94.3.120 "GET /home.jsp HTTP/1.1" 200 -
[04/20/2011 07:15:03 AM] 140.94.2.182 "HEAD /home.jsp HTTP/1.1" 200 -
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In Splunk all these lines are managed as 1 event.&lt;/P&gt;

&lt;P&gt;My Splunk configuration for the script:&lt;BR /&gt;
Command : D:\Product\Splunk\bin\scripts\FOR_TDA_TLS\readFolder.bat D:\Appli\LOGS\TDA_TLS &lt;/P&gt;

&lt;P&gt;interval: 20&lt;/P&gt;

&lt;P&gt;source type:  websphere_activity&lt;/P&gt;

&lt;P&gt;app: TDA&lt;/P&gt;

&lt;P&gt;index: websphere&lt;/P&gt;

&lt;P&gt;What do you think about this? &lt;BR /&gt;
Is it a problem with the script output? (End of line for example)&lt;BR /&gt;
Or problem with the Splunk configuration? (source type)&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 09:43:30 GMT</pubDate>
    <dc:creator>Nieucel</dc:creator>
    <dc:date>2020-09-28T09:43:30Z</dc:date>
    <item>
      <title>Issue to manage single event with Splunk input data script.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Issue-to-manage-single-event-with-Splunk-input-data-script/m-p/39896#M7422</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I connect a bat script as input data to my Splunk instance.&lt;BR /&gt;
This script reads a folder of websphere log files, for each websphere log file, it processes &lt;BR /&gt;
a conversion of TIMESTAMP: French TIMESTAMP (with accents) to 'Standard' TIMESTAMP.&lt;BR /&gt;
e.g.: event converted:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[03/01/2011 08:01:37 AM]Servlet.Engine.Transports : 8730 [error] HTTP0402E Invalid Request
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The script display all converted events on the STDOUT.&lt;BR /&gt;
My issue is that Splunk manage all events from one file as only one multi-line event.(so, I get as many events than file number.)&lt;/P&gt;

&lt;P&gt;e.g.: &lt;BR /&gt;
script stdout for 1 file read:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[12/13/2010 07:13:56 AM] 140.94.3.120 "GET /home.jsp HTTP/1.1" 200 -
[03/01/2011 08:01:37 AM]Servlet.Engine.Transports : 8730 [error] HTTP0402E Invalid Request 1
[03/05/2011 08:59:08 AM]Servlet.Engine.Transports : 9179 [error] HTTP0402E Invalid Request 1
[03/10/2011 09:06:46 AM]Servlet.Engine.Transports : 9243 [error] HTTP0402E Invalid Request 1
[03/15/2011 07:15:00 AM] 140.94.3.120 "GET /home.jsp HTTP/1.1" 200 -
[03/20/2011 07:15:03 AM] 140.94.2.182 "HEAD /home.jsp HTTP/1.1" 200 -
[04/01/2011 08:01:37 AM]Servlet.Engine.Transports : 8730 [error] HTTP0402E Invalid Request 1
[04/05/2011 08:59:08 AM]Servlet.Engine.Transports : 9179 [error] HTTP0402E Invalid Request 1
[04/10/2011 09:06:46 AM]Servlet.Engine.Transports : 9243 [error] HTTP0402E Invalid Request
[04/15/2011 07:15:00 AM] 140.94.3.120 "GET /home.jsp HTTP/1.1" 200 -
[04/20/2011 07:15:03 AM] 140.94.2.182 "HEAD /home.jsp HTTP/1.1" 200 -
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In Splunk all these lines are managed as 1 event.&lt;/P&gt;

&lt;P&gt;My Splunk configuration for the script:&lt;BR /&gt;
Command : D:\Product\Splunk\bin\scripts\FOR_TDA_TLS\readFolder.bat D:\Appli\LOGS\TDA_TLS &lt;/P&gt;

&lt;P&gt;interval: 20&lt;/P&gt;

&lt;P&gt;source type:  websphere_activity&lt;/P&gt;

&lt;P&gt;app: TDA&lt;/P&gt;

&lt;P&gt;index: websphere&lt;/P&gt;

&lt;P&gt;What do you think about this? &lt;BR /&gt;
Is it a problem with the script output? (End of line for example)&lt;BR /&gt;
Or problem with the Splunk configuration? (source type)&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:43:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Issue-to-manage-single-event-with-Splunk-input-data-script/m-p/39896#M7422</guid>
      <dc:creator>Nieucel</dc:creator>
      <dc:date>2020-09-28T09:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Issue to manage single event with Splunk input data script.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Issue-to-manage-single-event-with-Splunk-input-data-script/m-p/39897#M7423</link>
      <description>&lt;P&gt;You need to tell splunk that this scripted input is not a multiline event. &lt;BR /&gt;
I would add the following to a props.conf file in the app.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[websphere_activity]
LINE_BREAKER = ([\r\n]+)
SHOULD_LINEMERGE = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The linebreaker should be the default but it doesn't hurt to redefine it.&lt;/P&gt;

&lt;P&gt;It is worth noting that you could probably do without the script altogether and index the files directly. Splunk is good at detecting foreign languages and adjusting accordingly though you can tell it what the format is with the following.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_FORMAT = &amp;lt;strptime-style format&amp;gt;
CHARSET = &amp;lt;string&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;by the way, it is worth noting this is an index time change so it will not fix any data already in your index.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jul 2011 10:50:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Issue-to-manage-single-event-with-Splunk-input-data-script/m-p/39897#M7423</guid>
      <dc:creator>BobM</dc:creator>
      <dc:date>2011-07-10T10:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Issue to manage single event with Splunk input data script.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Issue-to-manage-single-event-with-Splunk-input-data-script/m-p/39898#M7424</link>
      <description>&lt;P&gt;Thank you very much for the quick response.&lt;BR /&gt;
Now, with the props.conf configuration, my script is well working.&lt;/P&gt;

&lt;P&gt;Just a remark:&lt;BR /&gt;
I have to go through this script, because the event 'French' style with this kind of timestamp format:&lt;BR /&gt;
[lun. déc. 13, 2010 07:13:56 AM] 140.94.3.120 "GET /home.jsp HTTP/1.1" 200 - &lt;BR /&gt;
Are not well managed by Splunk.&lt;/P&gt;

&lt;P&gt;regards&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2011 08:40:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Issue-to-manage-single-event-with-Splunk-input-data-script/m-p/39898#M7424</guid>
      <dc:creator>Nieucel</dc:creator>
      <dc:date>2011-07-11T08:40:28Z</dc:date>
    </item>
  </channel>
</rss>

