On 04/04/2018 06:28 PM, David Lang wrote:
On Wed, 4 Apr 2018, David Lang wrote:
On Wed, 4 Apr 2018, Rich Megginson wrote:
On 04/04/2018 05:57 PM, David Lang wrote:
On Wed, 4 Apr 2018, Rich Megginson via rsyslog wrote:
On 04/04/2018 05:22 PM, David Lang wrote:
I'm trying to use mmkubernetes where the docker containers are
logging via journald.
my config is:
module(load="imfile" PollingInterval="10") # provided support for
monitoring alternate log files
module(load="imuxsock") # provides support for local system logging
(e.g.
via logger command)
module(load="imklog") # provides kernel logging support
(previously done by rklogd)
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
I don't see imjournal here?
module(load="mmkubernetes"
kubernetesurl="http://k8s-master.lc.dc.openx.org:8080"
tls.cacert="/etc/ssl/certs/ca-bundle.crt"
allowunsignedcerts="on"
token="foobar"
annotation_match=[".*"]
filenamerules="rule=:/var/log/containers/"
filenamerules is an array value:
https://github.com/rsyslog/rsyslog/blob/master/contrib/mmkubernetes/mmkubernetes.c#L183
That may be causing the crash.
so there is a doc bug:
http://www.rsyslog.com/doc/v8-stable/configuration/modules/mmkubernetes.html?highlight=kubernetes#filenamerules
Does it work if you use a filenamerules like this:
https://github.com/rsyslog/rsyslog/blob/master/contrib/mmkubernetes/mmkubernetes.c#L78
filenamerules=[":/var/log/containers/%pod_name:char-to:.%.%container_hash:char-to:_%_%namespace_name:char-to:_%_%container_name:char-to:-%-%container_id:char-to:.%.log",":/var/log/containers/%pod_name:char-to:_%_%namespace_name:char-to:_%_%container_name:char-to:-%-%container_id:char-to:.%.log"]
still segfaults
module(load="imfile" PollingInterval="10") # provided support for
monitoring alternate log files
module(load="imuxsock") # provides support for local system logging
(e.g. via logger command)
module(load="imklog") # provides kernel logging support (previously
done by rklogd)
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
module(load="mmkubernetes"
kubernetesurl="http://k8s-master.lc.dc.openx.org:8080"
token="foobar"
annotation_match=[".*"]
filenamerules=[":/var/log/containers/%pod_name:char-to:.%.%container_hash:char-to:_%_%namespace_name:char-to:_%_%container_name:char-to:-%-%container_id:c
har-to:.%.log",":/var/log/containers/%pod_name:char-to:_%_%namespace_name:char-to:_%_%container_name:char-to:-%-%container_id:char-to:.%.log"]
)
action(type="mmkubernetes")
stop
but the following doesn't (it's not processing logs, so I need to add
the imjournal module)
no it doesn't, the error messages were lost in the debug output :-)
Stacktrace?
the debug output for the config above starting with the module load is:
7960.680695995:main thread : rsconf.c: cnf:global:obj: obj: 'module'
7960.680700067:main thread : rainerscript.c: nvlst 0x55ca470e76a0:
7960.680704148:main thread : rainerscript.c: name:
'filenamerules':
7960.680707930:main thread : rainerscript.c: ARRAY:
7960.680720787:main thread : rainerscript.c: string
':/var/log/containers/%pod_name:char-to:.%.%container_hash:char-to:_%_%namespace_name:char-to:_%_%container_name:char-to:-%-%container_id:c
har-to:.%.log'
7960.680737798:main thread : rainerscript.c: string
':/var/log/containers/%pod_name:char-to:_%_%namespace_name:char-to:_%_%container_name:char-to:-%-%container_id:char-to:.%.log'
7960.680750651:main thread : rainerscript.c: name:
'annotation_match':
7960.680754059:main thread : rainerscript.c: ARRAY:
7960.680764436:main thread : rainerscript.c: string '.*'
7960.680778540:main thread : rainerscript.c: name: 'token',
value 'foobar'
7960.680782221:main thread : rainerscript.c: name:
'kubernetesurl', value 'http://k8s-master.lc.dc.openx.org:8080'
7960.680786044:main thread : rainerscript.c: name: 'load',
value 'mmkubernetes'
7960.680789819:main thread : rainerscript.c: nvlstGetParam: name
'load', type 13, valnode->bUsed 0
7960.680793260:main thread : modules.c: modulesProcessCnf params:
7960.680796751:main thread : rainerscript.c: load: 'mmkubernetes'
7960.680803622:main thread : modules.c: Requested to load module
'mmkubernetes'
7960.680808070:main thread : modules.c: loading module
'/usr/lib64/rsyslog/mmkubernetes.so'
7960.681174148:main thread : mmkubernetes.c: mmkubernetes: module
compiled with rsyslog version 8.34.0.
7960.681181581:main thread : obj.c: caller requested object
'regexp', not found (iRet -3003)
7960.681190342:main thread : modules.c: Requested to load module
'lmregexp'
7960.681195495:main thread : modules.c: loading module
'/usr/lib64/rsyslog/lmregexp.so'
7960.681249645:main thread : modules.c: module lmregexp of type 2
being loaded (keepType=0).
7960.681254287:main thread : regexp.c: entry point
'isCompatibleWithFeature' not present in module
7960.681257540:main thread : regexp.c: entry point 'setModCnf' not
present in module
7960.681261006:main thread : regexp.c: entry point 'getModCnfName'
not present in module
7960.681264478:main thread : regexp.c: entry point 'beginCnfLoad'
not present in module
7960.681269824:main thread : modules.c: source file mmkubernetes.c
requested reference for module 'lmregexp', reference count now 1
7960.681363821:main thread : modules.c: module mmkubernetes of type
1 being loaded (keepType=1).
7960.681369614:main thread : modules.c: module config name is
'mmkubernetes'
7960.681373406:main thread : modules.c: module mmkubernetes
supports rsyslog v6 config interface
7960.681379155:main thread : mmkubernetes.c: entry point
'activateCnfPrePrivDrop' not present in module
7960.681384269:main thread : mmkubernetes.c: entry point 'doHUP'
not present in module
7960.681387971:main thread : mmkubernetes.c: entry point
'doHUPWrkr' not present in module
7960.681391592:main thread : mmkubernetes.c: entry point
'SetShutdownImmdtPtr' not present in module
7960.681395543:main thread : mmkubernetes.c: entry point
'beginTransaction' not present in module
7960.681399598:main thread : mmkubernetes.c: entry point
'commitTransaction' not present in module
7960.681403063:main thread : mmkubernetes.c: entry point
'endTransaction' not present in module
7960.681412022:main thread : rainerscript.c: nvlstGetParam: name
'kubernetesurl', type 14, valnode->bUsed 0
7960.681416597:main thread : rainerscript.c: nvlstGetParam: name
'token', type 14, valnode->bUsed 0
7960.681420271:main thread : rainerscript.c: nvlstGetParam: name
'annotation_match', type 15, valnode->bUsed 0
7960.681424721:main thread : rainerscript.c: nvlstGetParam: name
'filenamerules', type 15, valnode->bUsed 0
7960.681429223:main thread : mmkubernetes.c: module (global) param
blk for mmkubernetes:
7960.681433252:main thread : rainerscript.c: kubernetesurl:
'http://k8s-master.lc.dc.openx.org:8080'
7960.681440319:main thread : rainerscript.c: srcmetadatapath: (unset)
7960.681445060:main thread : rainerscript.c: dstmetadatapath: (unset)
7960.681449404:main thread : rainerscript.c: tls.cacert: (unset)
7960.681453790:main thread : rainerscript.c: allowunsignedcerts:
(unset)
7960.681458344:main thread : rainerscript.c: token: 'foobar'
7960.681464920:main thread : rainerscript.c: tokenfile: (unset)
7960.681471665:main thread : rainerscript.c: annotation_match: ARRAY:
7960.681475426:main thread : rainerscript.c: string '.*'
7960.681480411:main thread : rainerscript.c:
7960.681483237:main thread : rainerscript.c: de_dot: (unset)
7960.681489672:main thread : rainerscript.c: de_dot_separator: (unset)
7960.681496256:main thread : rainerscript.c: filenamerulebase: (unset)
7960.681501234:main thread : rainerscript.c: containerrulebase:
(unset)
7960.681505359:main thread : rainerscript.c: filenamerules: ARRAY:
7960.681509088:main thread : rainerscript.c: string
':/var/log/containers/%pod_name:char-to:.%.%container_hash:char-to:_%_%namespace_name:char-to:_%_%container_name:char-to:-%-%container_id:c
har-to:.%.log'
7960.681516597:main thread : rainerscript.c: string
':/var/log/containers/%pod_name:char-to:_%_%namespace_name:char-to:_%_%container_name:char-to:-%-%container_id:char-to:.%.log'
7960.681524384:main thread : rainerscript.c:
7960.681527203:main thread : rainerscript.c: containerrules: (unset)
-> $$ = nterm conf ()
Stack now 0
Entering state 1
Reading a token: Next token is token BEGIN_ACTION ()
Shifting token BEGIN_ACTION ()
Entering state 5
Reducing stack by rule 18 (line 159):
-> $$ = nterm nvlst ()
Stack now 0 1 5
Entering state 31
Reading a token: Next token is token NAME ()
Shifting token NAME ()
Entering state 58
Reading a token: Next token is token '=' ()
Shifting token '=' ()
Entering state 101
Reading a token: Next token is token STRING ()
Shifting token STRING ()
Entering state 136
Reducing stack by rule 21 (line 162):
$1 = token STRING ()
-> $$ = nterm value ()
Stack now 0 1 5 31 58 101
Entering state 137
Reducing stack by rule 20 (line 161):
$1 = token NAME ()
$2 = token '=' ()
$3 = nterm value ()
-> $$ = nterm nv ()
Stack now 0 1 5 31
Entering state 60
Reducing stack by rule 19 (line 160):
$1 = nterm nvlst ()
$2 = nterm nv ()
-> $$ = nterm nvlst ()
Stack now 0 1 5
Entering state 31
Reading a token: Next token is token ENDOBJ ()
Shifting token ENDOBJ ()
Entering state 62
Reducing stack by rule 41 (line 191):
$1 = token BEGIN_ACTION ()
$2 = nterm nvlst ()
$3 = token ENDOBJ ()
7960.681775980:main thread : rainerscript.c: nvlstGetParam: name
'type', type 14, valnode->bUsed 0
7960.681780548:main thread : ../action.c: action param blk after
actionNewInst:
7960.681783800:main thread : rainerscript.c: name: (unset)
7960.681788234:main thread : rainerscript.c: type: 'mmkubernetes'
7960.681794907:main thread : rainerscript.c: action.errorfile: (unset)
7960.681799879:main thread : rainerscript.c:
action.writeallmarkmessages: (unset)
7960.681806581:main thread : rainerscript.c:
action.execonlyeverynthtime: (unset)
7960.681811314:main thread : rainerscript.c:
action.execonlyeverynthtimetimeout: (unset)
7960.681816946:main thread : rainerscript.c:
action.execonlyonceeveryinterval: (unset)
7960.681821567:main thread : rainerscript.c:
action.execonlywhenpreviousissuspended: (unset)
7960.681825908:main thread : rainerscript.c:
action.repeatedmsgcontainsoriginalmsg: (unset)
7960.681830534:main thread : rainerscript.c:
action.resumeretrycount: (unset)
7960.681835127:main thread : rainerscript.c:
action.reportsuspension: (unset)
7960.681839572:main thread : rainerscript.c:
action.reportsuspensioncontinuation: (unset)
7960.681843962:main thread : rainerscript.c: action.resumeinterval:
(unset)
7960.681848315:main thread : rainerscript.c: action.copymsg: (unset)
7960.681854199:main thread : mmkubernetes.c: newActInst (mmkubernetes)
7960.681858431:main thread : mmkubernetes.c: action param blk in
mmkubernetes:
7960.681861781:main thread : rainerscript.c: kubernetesurl: (unset)
7960.681866035:main thread : rainerscript.c: srcmetadatapath: (unset)
7960.681870279:main thread : rainerscript.c: dstmetadatapath: (unset)
7960.681874406:main thread : rainerscript.c: tls.cacert: (unset)
7960.681878537:main thread : rainerscript.c: allowunsignedcerts:
(unset)
7960.681882607:main thread : rainerscript.c: token: (unset)
7960.681889027:main thread : rainerscript.c: tokenfile: (unset)
7960.681895075:main thread : rainerscript.c: annotation_match: (unset)
7960.681899424:main thread : rainerscript.c: de_dot: (unset)
7960.681905183:main thread : rainerscript.c: de_dot_separator: (unset)
7960.681909749:main thread : rainerscript.c: filenamerulebase: (unset)
7960.681916113:main thread : rainerscript.c: containerrulebase:
(unset)
7960.681920543:main thread : rainerscript.c: filenamerules: (unset)
7960.681924986:main thread : rainerscript.c: containerrules: (unset)
Segmentation fault
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE
THAT.