[SR-Users] how to prevent the log_prefix in syslog acc cdrs?

Karsten Horsmann khorsmann at gmail.com
Tue Nov 2 10:30:27 CET 2021


Hi List,

i thought there could be a solution to disable the log_prefix for acc
module - but i didn't found it. Is there a solution to supress log_prefix
for acc like acc_json did that?

I use kamailio 5.5.2 with that settings:

log_name="kamailio"
log_facility=LOG_LOCAL4
log_prefix="{$hdr(CSeq) $ci} "

the acc module then logs the "log_prefix" - plus some module/function stuff:

INFO: {1 INVITE SDkk50d01-1f7cc956b0b908e42d284189a11b44e7-ct46om0050} acc
[acc.c:285]: acc_log_request(): ACC: transaction answered:
timestamp=1635843776;utctime=2021-11-02
09:02:56;method=INVITE;from_tag=SDkk50d01-e8bc0cda;to_tag=XBr6apQ9HN4HD;call_id=SDkk50d01-1f7cc956b0b908e42d284189a11b44e7-ct46om0050;code=200;reason=OK;src_user=bob;src_domain=sip100;src_ip=172.20.120.56;dst_ouser=alice;dst_user=echo;dst_domain=172.20.120.59;user_agent=;x_t_call_id=;x_routing=;x_billing=
INFO: {1 ACK SDkk50d01-1f7cc956b0b908e42d284189a11b44e7-ct46om0050} acc
[acc.c:285]: acc_log_request(): ACC: request acknowledged:
timestamp=1635843776;utctime=2021-11-02
09:02:56;method=ACK;from_tag=SDkk50d01-e8bc0cda;to_tag=XBr6apQ9HN4HD;call_id=SDkk50d01-1f7cc956b0b908e42d284189a11b44e7-ct46om0050;code=200;reason=OK;src_user=bob;src_domain=sip100;src_ip=172.20.120.56;dst_ouser=alice;dst_user=alice;dst_domain=172.20.120.51;user_agent=;x_t_call_id=;x_routing=;x_billing=
INFO: {2 BYE SDkk50d01-1f7cc956b0b908e42d284189a11b44e7-ct46om0050} acc
[acc.c:285]: acc_log_request(): ACC: transaction answered:
timestamp=1635843833;utctime=2021-11-02
09:03:53;method=BYE;from_tag=SDkk50d01-e8bc0cda;to_tag=XBr6apQ9HN4HD;call_id=SDkk50d01-1f7cc956b0b908e42d284189a11b44e7-ct46om0050;code=200;reason=OK;src_user=bob;src_domain=sip100;src_ip=172.20.120.56;dst_ouser=alice;dst_user=alice;dst_domain=172.20.120.51;user_agent=;x_t_call_id=;x_routing=;x_billing=

The acc_json module is able to log acc without log_prefix:

{"time": "2021/11/02 10:02:56", "method": "INVITE", "from_tag":
"SDkk50d01-e8bc0cda", "to_tag": "XBr6apQ9HN4HD", "callid":
"SDkk50d01-1f7cc956b0b908e42d284189a11b44e7-ct46om0050", "sip_code": "200",
"sip_reason": "OK", "src_user": "bob", "src_domain": "sip100", "src_ip":
"172.20.120.56", "dst_ouser": "alice", "dst_user": "echo", "dst_domain":
"172.20.120.59", "user_agent": "", "x_t_call_id": "", "x_routing": "",
"x_billing": ""}
{"time": "2021/11/02 10:03:53", "method": "BYE", "from_tag":
"SDkk50d01-e8bc0cda", "to_tag": "XBr6apQ9HN4HD", "callid":
"SDkk50d01-1f7cc956b0b908e42d284189a11b44e7-ct46om0050", "sip_code": "200",
"sip_reason": "OK", "src_user": "bob", "src_domain": "sip100", "src_ip":
"172.20.120.56", "dst_ouser": "alice", "dst_user": "alice", "dst_domain":
"172.20.120.51", "user_agent": "", "x_t_call_id": "", "x_routing": "",
"x_billing": ""}

And just for the records - how to get rid off the rsyslog prefix time/date
stuff:

# /etc/rsyslog.d/kamailio.conf
# drop :msg from rtpengine with "timer run time" - debugging only:
:msg, contains, "timer run time" ~
# Template only msg:
$template myFormat,"%msg%\n"
# log only to local* and NOT to /var/log/messages
local6.*;local6.!=info
 -/var/log/platform/voip/kamailio/rtpengine.log
local6.*                                                stop
local5.*
 -/var/log/platform/voip/kamailio/rtpengine-cdr.log; myFormat
local5.*                                                stop
local4.*
 -/var/log/platform/voip/kamailio/kamailio.log
local4.*                                                stop
local2.*
 -/var/log/platform/voip/kamailio/kamailio-cdr.log; myFormat
local2.*                                                stop
local1.*
 -/var/log/platform/voip/kamailio/kamailio-cdr-json.log; myFormat
local1.*                                                stop

-- 
Mit freundlichen Grüßen
*Karsten Horsmann*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20211102/0b407efd/attachment.htm>


More information about the sr-users mailing list