How MaxMessageSize works?

General discussions here

Moderator: rgerhards

Google Ads


How MaxMessageSize works?

Postby fivesheep » Tue Dec 13, 2016 12:27 am

I was trying to figure out how rsyslog truncate message when a single line of message is too large. I have use the put `global(maxMessageSize="1024")` at the beginning of the conf file, however, even if I emit logs with size 2048 (doubled of the maxMessageSize setting), I am still able to get the whole message back from the output file. To my understand, I suppose to get truncated message from there. am I wrong about it, or there's something missing from my conf file?
can anyone help take a look? I am using rsyslog v8.23, and the conf file is shown as below:
Code: Select all
global(maxMessageSize="1024")

$DirCreateMode 0755
$WorkDirectory /home/foo/test/workdir
$Umask 0022
$PreserveFQDN on

module(load="imfile")
module(load="builtin:omfile")
module(load="omkafka")

input(
    type="imfile"
    File="/home/foo/test/input.log"
    readMode="0"
    Tag="app1"
    ruleset="ruleset_app1"
    addmetadata="on"
)

template(name="app1" type="list" option.json="on") {
    constant(value="{\"message\":\"")
    property(name="msg")
    constant(value="\",\"timestamp_produce\":\"")
    property(name="timegenerated" dateFormat="rfc3339")
    constant(value="\",\"type\":\"")
    property(name="syslogtag")
    constant(value="\",\"path\":\"")
    property(name="$!metadata!filename")
    constant(value="\",\"fingerprint\":\"")
    property(name="msgid")
    constant(value="\"}")
    constant(value="\n")
}

ruleset(name="ruleset_app1") {
    action(type="omfile"
           name="omfile_app1"
           file="/home/foo/test/output.log"
           template="app1")
}
fivesheep
New
 
Posts: 4
Joined: Tue Dec 13, 2016 12:19 am

Urgent Question?

  • Pulling out your Hair?
  • Wasting Time and Money?
  • Deadline Approaching?

Re: How MaxMessageSize works?

Postby dlang » Tue Dec 13, 2016 12:32 am

In at least some versions, imfile doesn't honor maxmessagelength
dlang
Frequent Poster
 
Posts: 1001
Joined: Mon Sep 15, 2008 7:44 am

Re: How MaxMessageSize works?

Postby fivesheep » Tue Dec 13, 2016 1:34 am

dlang wrote:In at least some versions, imfile doesn't honor maxmessagelength


even if imfile doesn't honor the setting, the output model should still capture it, isn't it true? I have tried both omfile and omkafka, they both seemed to ignore the setting..
fivesheep
New
 
Posts: 4
Joined: Tue Dec 13, 2016 12:19 am

Re: How MaxMessageSize works?

Postby dlang » Tue Dec 13, 2016 1:53 am

no, maxmessagesize has no effect on the output
dlang
Frequent Poster
 
Posts: 1001
Joined: Mon Sep 15, 2008 7:44 am

Google Ads



Return to General

Who is online

Users browsing this forum: No registered users and 2 guests

cron