Skip to content

Commit 1a2b5fe

Browse files
author
Helen Campbell
committed
Addition of splunk_hec metric server type
1 parent 477ed21 commit 1a2b5fe

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ Integer: How long to retain collect metrics, in days. Defaults to `90`.
6060
##### metrics_server_info
6161

6262
Struct:
63-
metrics_server_type => Enum['influxdb','graphite'],
63+
metrics_server_type => Enum['influxdb','graphite','splunk_hec'],
6464
hostname => String,
6565
port => Optional[Integer],
6666
db_name => Optional[String],
6767

68-
Specifies a metrics server to write data to. Currently it supports `influxdb` and `graphite` type servers. The parameters `metrics_server_type` and `hostname` are both required, and `dbname` is required for a `metrics_server_type` of `influxdb`.
68+
Specifies a metrics server to write data to. Currently it supports `influxdb`, `graphite` and `splnk_hec` type servers. The parameters `metrics_server_type` and `hostname` are both required, and `dbname` is required for a `metrics_server_type` of `influxdb`.
6969

7070
Example:
7171
```
@@ -77,6 +77,9 @@ Puppet_metrics_collector::Metrics_server{ 'collectmydataplease':
7777
}]
7878
```
7979

80+
For a `splunk_hec` setup please note that this will require the module `splunk_hec` installed, which can be found here on the Forge [here](https://forge.puppet.com/puppetlabs/splunk_hec) or [here](https://github.com/puppetlabs/puppetlabs-splunk_hec) on github.
81+
Further setup instructions for using the `splunk_hec` module can be found within the modules own README.md.
82+
8083
## Usage
8184

8285

manifests/pe_metric.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
$metrics_command = $metrics_server_type ? {
6666
'influxdb' => "${port_metrics_command} --influx-db ${metrics_server_db} > /dev/null",
6767
'graphite' => "${port_metrics_command} > /dev/null",
68+
'splunk_hec' => "${port_metrics_command} | /opt/puppetlabs/bin/puppet splunk_hec --sourcetype puppet:metrics --pe_metrics > /dev/null",
6869
default => "${port_metrics_command} > /dev/null",
6970
}
7071
} else {

types/metrics_server.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
type Puppet_metrics_collector::Metrics_server = Struct[{
2-
metrics_server_type => Enum['influxdb','graphite'],
2+
metrics_server_type => Enum['influxdb','graphite', 'splunk_hec'],
33
hostname => String,
44
port => Optional[Integer],
55
db_name => Optional[String],

0 commit comments

Comments
 (0)