Add "json_pretty" log format, currently the same as "json".

In a future version, "json" will be an alias for "json_compact"
instead.  GitHub issue #357.
This commit is contained in:
Todd C. Miller
2024-03-09 10:59:54 -07:00
parent 1debad3bec
commit 46e31a74d7
14 changed files with 135 additions and 92 deletions

View File

@@ -16,7 +16,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.TH "SUDO_LOGSRVD.CONF" "@mansectform@" "March 8, 2024" "Sudo @PACKAGE_VERSION@" "File Formats Manual"
.TH "SUDO_LOGSRVD.CONF" "@mansectform@" "March 9, 2024" "Sudo @PACKAGE_VERSION@" "File Formats Manual"
.nh
.if n .ad l
.SH "NAME"
@@ -688,30 +688,40 @@ Supported log formats are:
.PD 0
.TP 6n
json
Log events in JSON format.
The JSON log entries contain the full contents of the accept, reject, exit
Currently, this is an alias for
\fIjson_pretty\fR.
In a future version of
\fBsudo_logsrvd\fR,
\fIjson\fR
will be equivalent to
\fIjson_compact\fR.
JSON log entries contain the full contents of the accept, reject, exit
and alert messages.
.PD
.TP 6n
json_compact
Log events in
\(lqcompact\(rq
(minified) JSON format.
Each event is written as a separate JSON object on single line without
extraneous white space.
Due to limitations of the protocol, JSON events sent via
\fIsyslog\fR
may be truncated.
.TP 6n
json_pretty
Log events in
\(lqpretty\(rq
JSON format.
When logging to a file, the entire file is treated as a single JSON
object consisting of multiple events, each event spanning multiple lines.
When logging via
\fIsyslog\fR,
events are stored in compact (minified) format, described below.
.PD
.TP 6n
json_compact
Log events in compact (minified) JSON format.
Each event is written as a separate JSON object on single line without
extraneous white space.
When logging via
\fIsyslog\fR,
there is no difference between the
\fIjson\fR
\fIjson_pretty\fR
and
\fIjson_compact\fR
formats.
Due to limitations of the protocol, JSON events sent via
\fIsyslog\fR
may be truncated.
.TP 6n
sudo
Log events in traditional sudo-style log format.

View File

@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd March 8, 2024
.Dd March 9, 2024
.Dt SUDO_LOGSRVD.CONF @mansectform@
.Os Sudo @PACKAGE_VERSION@
.Sh NAME
@@ -614,28 +614,37 @@ The event log format.
Supported log formats are:
.Bl -tag -width 4n
.It json
Log events in JSON format.
The JSON log entries contain the full contents of the accept, reject, exit
Currently, this is an alias for
.Em json_pretty .
In a future version of
.Nm sudo_logsrvd ,
.Em json
will be equivalent to
.Em json_compact .
JSON log entries contain the full contents of the accept, reject, exit
and alert messages.
.It json_compact
Log events in
.Dq compact
(minified) JSON format.
Each event is written as a separate JSON object on single line without
extraneous white space.
Due to limitations of the protocol, JSON events sent via
.Em syslog
may be truncated.
.It json_pretty
Log events in
.Dq pretty
JSON format.
When logging to a file, the entire file is treated as a single JSON
object consisting of multiple events, each event spanning multiple lines.
When logging via
.Em syslog ,
events are stored in compact (minified) format, described below.
.It json_compact
Log events in compact (minified) JSON format.
Each event is written as a separate JSON object on single line without
extraneous white space.
When logging via
.Em syslog ,
there is no difference between the
.Em json
.Em json_pretty
and
.Em json_compact
formats.
Due to limitations of the protocol, JSON events sent via
.Em syslog
may be truncated.
.It sudo
Log events in traditional sudo-style log format.
See the

View File

@@ -25,7 +25,7 @@
.nr BA @BAMAN@
.nr LC @LCMAN@
.nr PS @PSMAN@
.TH "SUDOERS" "@mansectform@" "March 8, 2024" "Sudo @PACKAGE_VERSION@" "File Formats Manual"
.TH "SUDOERS" "@mansectform@" "March 9, 2024" "Sudo @PACKAGE_VERSION@" "File Formats Manual"
.nh
.if n .ad l
.SH "NAME"
@@ -5381,30 +5381,40 @@ Supported log formats are:
.PD 0
.TP 6n
json
Log events in JSON format.
Currently, this is an alias for
\fIjson_pretty\fR.
In a future version of
\fBsudo\fR,
\fIjson\fR
will be equivalent to
\fIjson_compact\fR.
JSON log entries contain the full user details as well as the execution
environment if the command was allowed.
.PD
.TP 6n
json_compact
Log events in
\(lqcompact\(rq
(minified) JSON format.
Each event is written as a separate JSON object on single line without
extraneous white space.
Due to limitations of the protocol, JSON events sent via
\fIsyslog\fR
may be truncated.
.TP 6n
json_pretty
Log events in
\(lqpretty\(rq
JSON format.
When logging to a file, the entire file is treated as a single JSON
object consisting of multiple events, each event spanning multiple lines.
When logging via
\fIsyslog\fR,
events are stored in compact (minified) format, described below.
.PD
.TP 6n
json_compact
Log events in compact (minified) JSON format.
Each event is written as a separate JSON object on single line without
extraneous white space.
When logging via
\fIsyslog\fR,
there is no difference between the
\fIjson\fR
\fIjson_pretty\fR
and
\fIjson_compact\fR
formats.
Due to limitations of the protocol, JSON events sent via
\fIsyslog\fR
may be truncated.
.TP 6n
sudo
Log events in traditional sudo-style format, see

View File

@@ -25,7 +25,7 @@
.nr BA @BAMAN@
.nr LC @LCMAN@
.nr PS @PSMAN@
.Dd March 8, 2024
.Dd March 9, 2024
.Dt SUDOERS @mansectform@
.Os Sudo @PACKAGE_VERSION@
.Sh NAME
@@ -5054,28 +5054,37 @@ The event log format.
Supported log formats are:
.Bl -tag -width 4n
.It json
Log events in JSON format.
Currently, this is an alias for
.Em json_pretty .
In a future version of
.Nm sudo ,
.Em json
will be equivalent to
.Em json_compact .
JSON log entries contain the full user details as well as the execution
environment if the command was allowed.
.It json_compact
Log events in
.Dq compact
(minified) JSON format.
Each event is written as a separate JSON object on single line without
extraneous white space.
Due to limitations of the protocol, JSON events sent via
.Em syslog
may be truncated.
.It json_pretty
Log events in
.Dq pretty
JSON format.
When logging to a file, the entire file is treated as a single JSON
object consisting of multiple events, each event spanning multiple lines.
When logging via
.Em syslog ,
events are stored in compact (minified) format, described below.
.It json_compact
Log events in compact (minified) JSON format.
Each event is written as a separate JSON object on single line without
extraneous white space.
When logging via
.Em syslog ,
there is no difference between the
.Em json
.Em json_pretty
and
.Em json_compact
formats.
Due to limitations of the protocol, JSON events sent via
.Em syslog
may be truncated.
.It sudo
Log events in traditional sudo-style format, see
.Sx "EVENT LOGGING"