Inspec log file location


#1

Hi All,
we are running inspec exec profile on node and getting the result on same on but we want to capture that profile result logs and send to centralize logging system.

any idea if we can specify the log file location to capture inspec profile results?


#2

Parsing the result to json and then simply redirect the output to your desired destination
inspec exec ... --format=json >> desired_path


#3

Thanks Simark.
i was looking for any configuration where log location can be set.
inspec does provided --log-location flag and i have tried to use in below format.
"inspec exec --log-location /data/inspec.log wrapper-profile/"
even though inspec.log file gets created after inspec exec but does not output the results.

cat /data/inspec.log
"# Logfile created on 2017-09-29 07:32:10 +1000 by logger.rb/54362"


#4

bkeshark,
I am not a huge expect on this. But the way I understood this switch is that it is only for Diagnostic Messages.

[--log-location=LOG_LOCATION]                # Location to send diagnostic log messages to. (default: STDOUT or STDERR)