File: syslog-ng.conf.5

package info (click to toggle)
syslog-ng 3.8.1-10
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 47,320 kB
  • ctags: 43,937
  • sloc: ansic: 159,432; yacc: 25,059; sh: 13,574; makefile: 4,669; python: 3,468; java: 3,218; xml: 2,309; perl: 318; lex: 316; awk: 184
file content (643 lines) | stat: -rw-r--r-- 15,038 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
'\" t
.\"     Title: syslog-ng.conf
.\"    Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\"      Date: 08/19/2016
.\"    Manual: The syslog-ng.conf manual page
.\"    Source: syslog-ng Open Source Edition 3.3
.\"  Language: English
.\"
.TH "SYSLOG\-NG\&.CONF" "5" "08/19/2016" "syslog\-ng Open Source Edition" "The syslog-ng.conf manual page"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
syslog-ng.conf \- syslog\-ng configuration file
.SH "SYNOPSIS"
.HP \w'\fBsyslog\-ng\&.conf\fR\ 'u
\fBsyslog\-ng\&.conf\fR
.SH "DESCRIPTION"
.PP
This manual page is only an abstract; for the complete documentation of syslog\-ng, see
\m[blue]\fB\fBThe syslog\-ng Open Source Edition Administrator Guide\fR\fR\m[]\&\s-2\u[1]\d\s+2
or
\m[blue]\fBthe official syslog\-ng website\fR\m[]\&\s-2\u[2]\d\s+2\&.
.PP
The syslog\-ng OSE application is a flexible and highly scalable system logging application\&. Typically, syslog\-ng is used to manage log messages and implement centralized logging, where the aim is to collect the log messages of several devices on a single, central log server\&. The different devices \- called syslog\-ng clients \- all run syslog\-ng, and collect the log messages from the various applications, files, and other
\fIsources\fR\&. The clients send all important log messages to the remote syslog\-ng server, where the server sorts and stores them\&.
.PP
The syslog\-ng application reads incoming messages and forwards them to the selected
\fIdestinations\fR\&. The syslog\-ng application can receive messages from files, remote hosts, and other
\fIsources\fR\&.
.PP
Log messages enter syslog\-ng in one of the defined sources, and are sent to one or more
\fIdestinations\fR\&.
.PP
Sources and destinations are independent objects;
\fIlog paths\fR
define what syslog\-ng does with a message, connecting the sources to the destinations\&. A log path consists of one or more sources and one or more destinations; messages arriving from a source are sent to every destination listed in the log path\&. A log path defined in syslog\-ng is called a
\fIlog statement\fR\&.
.PP
Optionally, log paths can include
\fIfilters\fR\&. Filters are rules that select only certain messages, for example, selecting only messages sent by a specific application\&. If a log path includes filters, syslog\-ng sends only the messages satisfying the filter rules to the destinations set in the log path\&.
.SH "CONFIGURING SYSLOG-NG"
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The main body of the configuration file consists of object definitions: sources, destinations, logpaths define which log message are received and where they are sent\&. All identifiers, option names and attributes, and any other strings used in the syslog\-ng configuration file are case sensitive\&. Objects must be defined before they are referenced in another statement\&. Object definitions (also called statements) have the following syntax:
.sp
.if n \{\
.RS 4
.\}
.nf
object_type object_id {<options>};
.fi
.if n \{\
.RE
.\}
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIType of the object\fR: One of
\fIsource\fR,
\fIdestination\fR,
\fIlog\fR,
\fIfilter\fR,
\fIparser\fR,
\fIrewrite\fR
rule, or
\fItemplate\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIIdentifier of the object\fR: A unique name identifying the object\&. When using a reserved word as an identifier, enclose the identifier in quotation marks\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBTip\fR
.ps -1
.br
Use identifiers that refer to the type of the object they identify\&. For example, prefix source objects with
\fIs_\fR, destinations with
\fId_\fR, and so on\&.
.sp .5v
.RE
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fIParameters\fR: The parameters of the object, enclosed in braces
\fI{parameters}\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fISemicolon\fR: Object definitions end with a semicolon (\fI;\fR)\&.
.RE
.sp
For example, the following line defines a source and calls it
\fIs_internal\fR\&.
.sp
.if n \{\
.RS 4
.\}
.nf
source s_internal { internal(); };
.fi
.if n \{\
.RE
.\}
.sp
The object can be later referenced in other statements using its ID, for example, the previous source is used as a parameter of the following log statement:
.sp
.if n \{\
.RS 4
.\}
.nf
log { source(s_internal); destination(d_file); };
.fi
.if n \{\
.RE
.\}
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
The parameters and options within a statement are similar to function calls of the C programming language: the name of the option followed by a list of its parameters enclosed within brackets and terminated with a semicolon\&.
.sp
.if n \{\
.RS 4
.\}
.nf
option(parameter1, parameter2); option2(parameter1, parameter2);
.fi
.if n \{\
.RE
.\}
.sp
For example, the following source statement has three options; the first two options (\fIfile()\fR
and
\fIfollow_freq()\fR) have a single parameter, while the third one (\fIflags()\fR) has two parameters:
.sp
.if n \{\
.RS 4
.\}
.nf
source s_tail { file("/var/log/apache/access\&.log"
    follow_freq(1) flags(no\-parse, validate\-utf8)); };
.fi
.if n \{\
.RE
.\}
.sp
Objects may have required and optional parameters\&. Required parameters are positional, meaning that they must be specified in a defined order\&. Optional parameters can be specified in any order using the
option(value)
format\&. If a parameter (optional or required) is not specified, its default value is used\&. The parameters and their default values are listed in the reference section of the particular object\&.
.PP
\fBExample\ \&1.\ \&Using required and optional parameters\fR
The
\fIunix\-stream()\fR
source driver has a single required argument: the name of the socket to listen on\&. Optional parameters follow the socket name in any order, so the following source definitions have the same effect:
.sp
.if n \{\
.RS 4
.\}
.nf
source s_demo_stream1 {
        unix\-stream("/dev/log" max\-connections(10) group(log)); };
source s_demo_stream2 {
        unix\-stream("/dev/log" group(log) max\-connections(10)); };
.fi
.if n \{\
.RE
.\}
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Some options are global options, or can be set globally, for example, whether syslog\-ng OSE should use DNS resolution to resolve IP addresses\&. Global options are detailed in
???\&.
.sp
.if n \{\
.RS 4
.\}
.nf
options { use_dns(no); };
.fi
.if n \{\
.RE
.\}
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
All identifiers, attributes, and any other strings used in the syslog\-ng configuration file are case sensitive\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
Objects can be used before definition\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
To add comments to the configuration file, start a line with
\fI#\fR
and write your comments\&. These lines are ignored by syslog\-ng\&.
.sp
.if n \{\
.RS 4
.\}
.nf
# Comment: This is a stream source
source s_demo_stream {
        unix\-stream("/dev/log" max\-connections(10) group(log)); };
.fi
.if n \{\
.RE
.\}
.RE
.PP
The syntax of log statements is as follows:
.sp
.if n \{\
.RS 4
.\}
.nf
log {
    source(s1); source(s2); \&.\&.\&.
    optional_element(filter1|parser1|rewrite1); optional_element(filter2|parser2|rewrite2);\&.\&.\&.
    destination(d1); destination(d2); \&.\&.\&.
    flags(flag1[, flag2\&.\&.\&.]);
    };
.fi
.if n \{\
.RE
.\}
.PP
The following log statement sends all messages arriving to the localhost to a remote server\&.
.sp
.if n \{\
.RS 4
.\}
.nf
source s_localhost { tcp(ip(127\&.0\&.0\&.1) port(1999) ); };
destination d_tcp { tcp("10\&.1\&.2\&.3" port(1999); localport(999)); };
log { source(s_localhost); destination(d_tcp); };
.fi
.if n \{\
.RE
.\}
.PP
The syslog\-ng application has a number of global options governing DNS usage, the timestamp format used, and other general points\&. Each option may have parameters, similarly to driver specifications\&. To set global options, add an option statement to the syslog\-ng configuration file using the following syntax:
.sp
.if n \{\
.RS 4
.\}
.nf
options { option1(params); option2(params); \&.\&.\&. };
.fi
.if n \{\
.RE
.\}
.PP
The sources, destinations, and filters available in syslog\-ng are listed below\&. For details, see
\m[blue]\fB\fBThe syslog\-ng Administrator Guide\fR\fR\m[]\&\s-2\u[1]\d\s+2\&.

\-       .sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.B Table\ \&1.\ \&Source drivers available in syslog-ng
.TS
allbox tab(:);
lB lB.
T{
Name
T}:T{
Description
T}
.T&
l l
l l
l l
l l
l l
l l
l l
l l
l l
l l
l l
l l.
T{
internal()
T}:T{
Messages generated internally in syslog\-ng\&.
T}
T{
file()
T}:T{
Opens the specified file and reads messages\&.
T}
T{
pipe(), fifo
T}:T{
Opens the specified named pipe and reads messages\&.
T}
T{
pacct()
T}:T{
Reads messages from the process accounting logs on Linux\&.
T}
T{
program()
T}:T{
Opens the specified application and reads messages from its standard output\&.
T}
T{
sun-stream(), sun-streams()
T}:T{
Opens the specified \fISTREAMS\fR device on Solaris systems and reads incoming messages\&.
T}
T{
syslog()
T}:T{
Listens for incoming messages using the new IETF-standard syslog protocol\&.
T}
T{
system()
T}:T{
Automatically detects which platform syslog\-ng OSE is running on, and collects the native log messages of that platform\&.
T}
T{
tcp(), tcp6()
T}:T{
Listens on the specified TCP port for incoming messages using the BSD-syslog protocol over IPv4 and IPv6 networks, respectively\&.
T}
T{
udp(), udp6()
T}:T{
Listens on the specified UDP port for incoming messages using the BSD-syslog protocol over IPv4 and IPv6 networks, respectively\&.
T}
T{
unix-dgram()
T}:T{
Opens the specified unix socket in \fISOCK_DGRAM\fR mode and listens for incoming messages\&.
T}
T{
unix-stream()
T}:T{
Opens the specified unix socket in \fISOCK_STREAM\fR mode and listens for incoming messages\&.
T}
.TE
.sp 1
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.B Table\ \&2.\ \&Destination drivers available in syslog-ng
.TS
allbox tab(:);
lB lB.
T{
Name
T}:T{
Description
T}
.T&
l l
l l
l l
l l
l l
l l
l l
l l
l l
l l.
T{
file()
T}:T{
Writes messages to the specified file\&.
T}
T{
fifo(), pipe()
T}:T{
Writes messages to the specified named pipe\&.
T}
T{
program()
T}:T{
Forks and launches the specified program, and sends messages to its standard input\&.
T}
T{
sql()
T}:T{
Sends messages into an SQL database\&. In addition to the standard syslog\-ng packages, the \fIsql()\fR destination requires database\-specific packages to be installed\&. Refer to the section appropriate for your platform in ???\&.
T}
T{
syslog()
T}:T{
Sends messages to the specified remote host using the IETF-syslog protocol\&. The IETF standard supports message transport using the UDP, TCP, and TLS networking protocols\&.
T}
T{
tcp() and tcp6()
T}:T{
Sends messages to the specified TCP port of a remote host using the BSD-syslog protocol over IPv4 and IPv6, respectively\&.
T}
T{
udp() and udp6()
T}:T{
Sends messages to the specified UDP port of a remote host using the BSD-syslog protocol over IPv4 and IPv6, respectively\&.
T}
T{
unix-dgram()
T}:T{
Sends messages to the specified unix socket in \fISOCK_DGRAM\fR style (BSD)\&.
T}
T{
unix-stream()
T}:T{
Sends messages to the specified unix socket in \fISOCK_STREAM\fR style (Linux)\&.
T}
T{
usertty()
T}:T{
Sends messages to the terminal of the specified user, if the user is logged in\&.
T}
.TE
.sp 1
.sp
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.B Table\ \&3.\ \&Filter functions available in syslog-ng OSE
.TS
allbox tab(:);
lB lB.
T{
Name
T}:T{
Description
T}
.T&
l l
l l
l l
l l
l l
l l
l l
l l
l l
l l.
T{
facility()
T}:T{
Filter messages based on the sending facility\&.
T}
T{
filter()
T}:T{
Call another filter function\&.
T}
T{
host()
T}:T{
Filter messages based on the sending host\&.
T}
T{
level() or priority()
T}:T{
Filter messages based on their priority\&.
T}
T{
match()
T}:T{
Use a regular expression to filter messages based on a specified header or content field\&.
T}
T{
message()
T}:T{
Use a regular expression to filter messages based their content\&.
T}
T{
netmask()
T}:T{
Filter messages based on the IP address of the sending host\&.
T}
T{
program()
T}:T{
Filter messages based on the sending application\&.
T}
T{
source()
T}:T{
Select messages of the specified syslog\-ng OSE source statement\&.
T}
T{
tags()
T}:T{
Select messages having the specified tag\&.
T}
.TE
.sp 1
.SH "FILES"
.PP
/usr/local/
.PP
/usr/local/etc/syslog\-ng\&.conf
.SH "SEE ALSO"
.PP
\fBsyslog\-ng\fR(8)
.PP
\m[blue]\fB\fBThe syslog\-ng OSE 3\&.3 Administrator Guide\fR\fR\m[]\&\s-2\u[1]\d\s+2
.PP
If you experience any problems or need help with syslog\-ng, visit
\m[blue]\fBvisit the syslog\-ng wiki\fR\m[]\&\s-2\u[3]\d\s+2
or the
\m[blue]\fB\fBsyslog\-ng mailing list\fR\fR\m[]\&\s-2\u[4]\d\s+2\&.
.PP
For news and notifications about of syslog\-ng, visit the
\m[blue]\fB\fBsyslog\-ng Insider Blog\fR\fR\m[]\&\s-2\u[5]\d\s+2\&.
.SH "AUTHOR"
.PP
This manual page was written by the BalaBit Documentation Team <documentation@balabit\&.com>\&.
.SH "COPYRIGHT"
.SS ""
.PP
The authors grant permission to copy, distribute and/or modify this manual page under the terms of the GNU General Public License Version 2 or newer (GPL v2+)\&.
.SH "NOTES"
.IP " 1." 4
\fBThe syslog-ng Open Source Edition Administrator Guide\fR
.RS 4
\%http://www.balabit.com/support/documentation/
.RE
.IP " 2." 4
the official syslog-ng website
.RS 4
\%http://www.balabit.com/network-security/syslog-ng/
.RE
.IP " 3." 4
visit the syslog-ng wiki
.RS 4
\%http://www.balabit.com/wiki/syslog-ng-faq
.RE
.IP " 4." 4
\fBsyslog-ng mailing list\fR
.RS 4
\%https://lists.balabit.hu/mailman/listinfo/syslog-ng
.RE
.IP " 5." 4
\fBsyslog-ng Insider Blog\fR
.RS 4
\%http://insider.blogs.balabit.com
.RE