Skip to content

Commit

Permalink
Merge branch 'main' into PIE-1315-report_job_id
Browse files Browse the repository at this point in the history
  • Loading branch information
actowery authored Mar 26, 2024
2 parents 5d1b1a3 + f0c4fee commit 5e6d9b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ All notable changes to this project will be documented in this file. The format

### Fixed

- Bug fix preventing `sar` metrics collected by `puppet_metrics_collector::system` from being shipped to Splunk. [#214](https://github.com/puppetlabs/puppetlabs-splunk_hec/pull/214)

- Removed logic preventing `job_id` and `code_id` from being added to report data. [#213](https://github.com/puppetlabs/puppetlabs-splunk_hec/pull/213)

- The `collect_facts` parameter has been renamed to `facts_allowlist` to align with the `facts_blocklist` parameter. [#212](https://github.com/puppetlabs/puppetlabs-splunk_hec/pull/212)
Expand Down
7 changes: 6 additions & 1 deletion lib/puppet/application/splunk_hec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ def send_pe_metrics(data, sourcetype)
content.each_key do |serv|
event = event_template.clone
event['host'] = name
event['event'] = content[serv.to_s]
if content[serv.to_s].is_a?(Array)
event['event'] = {}
event['event']['metrics'] = content[serv.to_s]
else
event['event'] = content[serv.to_s]
end
event['event']['pe_console'] = pe_console
event['event']['pe_service'] = serv.to_s
Puppet.info 'Submitting metrics to Splunk'
Expand Down

0 comments on commit 5e6d9b1

Please sign in to comment.