<?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: Sending rsyslog JSON format in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Sending-rsyslog-JSON-format/m-p/271897#M52243</link>
    <description>&lt;P&gt;my application is using rsyslog to write logs, so anyway i need to find way to change the log format because it's not standard JSON.&lt;/P&gt;

&lt;P&gt;rsyslog default fromat is TIMESTAMP HOSTNAME APP MSG&lt;/P&gt;

&lt;P&gt;so we  solved this issue by creating new template at syslog  without timestamp,hostname,application  (in other words - just JSON messages)  &lt;/P&gt;

&lt;P&gt;By adding at /etc/rsyslog.d/mysqpplication.conf: &lt;BR /&gt;
$template MyTemplate,"%msg%\n"&lt;BR /&gt;
:programname, isequal, "MYSQPP" @10.0.100.220:555;MyTemplate&lt;/P&gt;

&lt;P&gt;And add to  /opt/splunk/etc/system/local/props.conf&lt;BR /&gt;
[MyApp]&lt;BR /&gt;
pulldown_type = true&lt;BR /&gt;
INDEXED_EXTRACTIONS = json&lt;BR /&gt;
KV_MODE = JSON&lt;BR /&gt;
category = Structured&lt;BR /&gt;
description = MyApp&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 07:33:58 GMT</pubDate>
    <dc:creator>shaharl</dc:creator>
    <dc:date>2020-09-29T07:33:58Z</dc:date>
    <item>
      <title>Sending rsyslog JSON format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sending-rsyslog-JSON-format/m-p/271894#M52240</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have tried today to integrate Splunk with Rsyslog that Contains JSON.&lt;BR /&gt;
The issue is that rsyslog is sending the information with timestamp, hostname, and application name before the JSON message that my application made.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2015 21:38:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sending-rsyslog-JSON-format/m-p/271894#M52240</guid>
      <dc:creator>shaharl</dc:creator>
      <dc:date>2015-10-13T21:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sending rsyslog JSON format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sending-rsyslog-JSON-format/m-p/271895#M52241</link>
      <description>&lt;P&gt;Can you post some sample log entries?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2015 21:55:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sending-rsyslog-JSON-format/m-p/271895#M52241</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-10-13T21:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sending rsyslog JSON format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sending-rsyslog-JSON-format/m-p/271896#M52242</link>
      <description>&lt;P&gt;JSON and Syslog are different formats and dont particularly play well together due to the nature of the format of syslog. There are some custom rules you can compile for Rsyslog that will help with JSON. &lt;/P&gt;

&lt;P&gt;BUT.. since you're using Splunk, why are you trying to ingest these with rsyslog? Why not use a Splunk Universal Forwarder and ingest the JSON files directly into Splunk. Splunk understands JSON format with no problems..&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 04:57:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sending-rsyslog-JSON-format/m-p/271896#M52242</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2015-10-14T04:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sending rsyslog JSON format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sending-rsyslog-JSON-format/m-p/271897#M52243</link>
      <description>&lt;P&gt;my application is using rsyslog to write logs, so anyway i need to find way to change the log format because it's not standard JSON.&lt;/P&gt;

&lt;P&gt;rsyslog default fromat is TIMESTAMP HOSTNAME APP MSG&lt;/P&gt;

&lt;P&gt;so we  solved this issue by creating new template at syslog  without timestamp,hostname,application  (in other words - just JSON messages)  &lt;/P&gt;

&lt;P&gt;By adding at /etc/rsyslog.d/mysqpplication.conf: &lt;BR /&gt;
$template MyTemplate,"%msg%\n"&lt;BR /&gt;
:programname, isequal, "MYSQPP" @10.0.100.220:555;MyTemplate&lt;/P&gt;

&lt;P&gt;And add to  /opt/splunk/etc/system/local/props.conf&lt;BR /&gt;
[MyApp]&lt;BR /&gt;
pulldown_type = true&lt;BR /&gt;
INDEXED_EXTRACTIONS = json&lt;BR /&gt;
KV_MODE = JSON&lt;BR /&gt;
category = Structured&lt;BR /&gt;
description = MyApp&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:33:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sending-rsyslog-JSON-format/m-p/271897#M52243</guid>
      <dc:creator>shaharl</dc:creator>
      <dc:date>2020-09-29T07:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sending rsyslog JSON format</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sending-rsyslog-JSON-format/m-p/271898#M52244</link>
      <description>&lt;P&gt;I did this with a similar situation where a syslog header was added to the front of XML events. In &lt;CODE&gt;props.conf&lt;/CODE&gt;, make a &lt;CODE&gt;LINE_BREAKER&lt;/CODE&gt; setting for the sourcetype (or whatever) and add the regex for the syslog header, and end with the opening of your JSON (XML in my example):&lt;/P&gt;

&lt;PRE&gt;`[sam:xml]
# Strips syslog header and makes events pure XML
LINE_BREAKER = (\d\s\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}-\d{2}:\d{2}\s[\w_-]+\s[\w-_]+\s\d+\s-\s-\s)
SHOULD_LINEMERGE = false`&lt;/PRE&gt;

&lt;P&gt;Obviously, your regex will vary. Post a sample event if you need help with the regex.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 12:42:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sending-rsyslog-JSON-format/m-p/271898#M52244</guid>
      <dc:creator>stmyers7941</dc:creator>
      <dc:date>2015-10-14T12:42:13Z</dc:date>
    </item>
  </channel>
</rss>

