Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
  - name: 'compute.node.cpu.percent'

    event_type: 'compute.metrics.update'

    type: 'gauge'

    unit: 'percent'

    volume: $.payload.metrics[?(@.name='cpu.percent')].value * 100

    resource_id: $.payload.host + "_" + $.payload.nodename

    timestamp: $.payload.metrics[?(@.name='cpu.percent')].timestamp

    metadata:

      event_type: $.event_type

      host: $.publisher_id

      source: $.payload.metrics[?(@.name='cpu.percent')].source

 

Using the schema above:

Code Block
languagebash
{
    "field_mappings": [
	    "set": [
		    {
			    "new_string": "counter_name",
				"collectd_field": {
					"plugin": "cpu"
				},
				"conversion": "cpu"
			},
			{
				"new_string": "counter_type",
				"collectd_field": {
					"values": {
						"gauge": "cumulative"
					}
				}
			},
			{
				"new_string": "counter_volume",
				"collectd_field": {
					"values": {
						"actual_values": "values_array"
					}
				}
				"conversion": "None"
			},
			{
				"new_string": "timestamp",
				"collectd_string": "timestamp"
			},
			{
				"new_string": "source",
				"new_value": "collectd"
			},
			{
				"new_string": "resource_id",
				"collectd_field": {
					"values": {
						"host": "uuid",
						"plugin instance": "plugin_instance"
					}
				}
			}
		]
	]
}

...