Puppet Report Logs
Puppet creates a report on its actions and your infrastructure every time it applies a catalog during a Puppet run. Site24x7 AppLogs has built-in support for Puppet report logs.
Getting started
1. Log in to your Site24x7 account.
2. Download and install the Site24x7 Server Monitoring Agent (Windows | Linux).
3. Go to Admin > AppLogs > Log Profile and select Add Log Profile.
4. Enter the Profile Name.
5. From the Choose the Log Type drop-down, select Puppet Report Logs.
- The Sample Logs and Log Pattern are displayed below.
Sample Logs:
{"host": "ip-172-31-13-154.us-east-2.compute.internal","time": "2021-07-28T15:01:38.026099904+00:00","configuration_version": 1627484498,"transaction_uuid": "6775bf60-a3ae-4b80-a15e-c8e602af16da","report_format": 10,"puppet_version": "5.5.10","message": "Using configured environment 'production'","status": "changed","transaction_completed": true,"noop": false,"noop_pending": false,"environment": "production","level": "info","source": "Puppet","catalog_application": 0.01703704400006245,"title": "/tmp/it_works.txt","file": "/etc/puppet/code/environments/production/manifests/site.pp","line": 1,"resource": "File[/tmp/it_works.txt]","resource_type": "File","provider_used": "posix","containment_path": ["Stage[main]","Main","File[/tmp/it_works.txt]"],"evaluation_time": 0.004674063,"failed": false,"failed_to_restart": false,"changed": true,"out_of_sync": true,"skipped": false,"change_count": 1,"out_of_sync_count": 1,"events": [{"audited": false,"property": "ensure","previous_value": "absent","desired_value": "present","historical_value": null,"message": "defined content as '{md5}b7765335cba924c39fe20334d017677d'","name": "file_created","status": "success","time": "2021-07-28T15:01:38.503277773+00:00","redacted": null,"corrective_change": true}],"corrective_change": true}
These logs are separated into fields, each of which takes its respective value and is then uploaded to Site24x7. - By default, this is the Log Pattern identified by AppLogs for Puppet report logs:
$host as Host$ $time:date:yyyy-MM-dd'T'HH:mm:ss.SX$ $configuration_version as ConfigVersion$ $transaction_uuid as TransUUID$ $report_format as ReportFormat$ $puppet_version as PuppetVersion$ $status as Status$ $environment as Environment$ $level as LogLevel$ $source as PuppetSource$ $catalog_application as CatalogApplication:decimal$ $title as Title$ $file as File$ $line as Line$ $resource as Resource$ $resource_type as ResourceType$ $provider_used$ $containment_path$ $evaluation_time as EvaluationTime:decimal$ $failed as Failed$ $failed_to_restart$ $changed$ $out_of_sync as OutOfSync$ $skipped$ $change_count$ $out_of_sync_count$ $events$ $corrective_change$ $message$ - You can add a custom Log Pattern instead of the default one. To do so, click the pencil icon and specify your pattern.
6. From the Log Source drop-down, select Local File.
7. By default, the paths below are used as the file sources:
Linux: "/opt/puppetlabs/server/data/puppetserver/reports/*.yaml", "/var/log/puppetlabs/puppetserver/reports/*.yaml"
- By default, Puppet writes the report in YAML format. The Site24x7 AppLogs agent will convert those entries to JSON format and upload them.
- If your source paths are different from the default paths, specify them in the List of files to search for logs field.
8. Select either monitors or monitor groups to collect the logs.
9. Click Save.
Dashboard
AppLogs creates an exclusive dashboard for every log type and shows a few widgets by default. Here's a list of the widgets available on the Puppet report logs dashboard:
- Total Requests
- Skipped Resources
- Out Of Sync Resources
- Resources Changed
- Failed Resources
- Average Catalog Application time
- Activity By Environment
- Top Nodes
- Logging Levels
- Puppet Version
- Top Erroneous nodes
- Top Warn Nodes
- Error Rate
- Top Errors
- Warn Reasons
- Warn Rate
- Resource Status
- Slowest Nodes by Catalog Application time