How to create each log file with a title top line

This is the place for you, if you got rsyslog up and running but wonder how to make it do what you want.

Moderator: rgerhards

Google Ads


How to create each log file with a title top line

Postby jeanlucp » Wed Oct 18, 2017 2:15 pm

I currently runs rsyslog 8.22 on an embedded linux distrib.
I filter with Facility and Severity syslog fields in order to dispatch my logs to different files.
These files are formatted with the help of a template in rsyslogd.conf as below :
template(name="CSVData" type="list") {
property(name="timereported" dateFormat="rfc3339")
constant(value=",")
property(name="syslogfacility-text" format="csv")
constant(value=",")
....
that outputs a like csv file and it works well.
My question is :
Is rsyslogd able to add a top line at beginning of each log file that allow to give a name to each column ?
Is it possible with rsyslogd configuration ?

Thank's
jeanlucp
New
 
Posts: 1
Joined: Wed Oct 18, 2017 1:40 pm

Urgent Question?

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

Re: How to create each log file with a title top line

Postby dlang » Wed Oct 18, 2017 5:11 pm

No, rsyslog has no ability to do anything special when creating a new file.
dlang
Frequent Poster
 
Posts: 1001
Joined: Mon Sep 15, 2008 7:44 am

Re: How to create each log file with a title top line

Postby frantz45 » Mon Oct 30, 2017 10:53 am

You can use logrotate to add the title line after rotating logs (see postrotate directive).
frantz45
New
 
Posts: 4
Joined: Fri Oct 27, 2017 4:19 pm

Google Ads



Return to Configuration

Who is online

Users browsing this forum: No registered users and 1 guest

cron