Add enum processor to map string 'state' field to int
Change-Id: Ice94f6543aa0d8f638ba31e5a775e2ca26f3e206
diff --git a/mongodb/meta/telegraf.yml b/mongodb/meta/telegraf.yml
index ea60745..159677f 100644
--- a/mongodb/meta/telegraf.yml
+++ b/mongodb/meta/telegraf.yml
@@ -3,4 +3,22 @@
agent:
input:
mongodb:
+ processor:
+ enum:
+ namepass: "mongodb"
+ mapping:
+ - field: "state"
+ default: -1
+ value_mappings:
+ # https://docs.mongodb.com/v2.6/reference/replica-states/
+ STARTUP: 0
+ PRIMARY: 1
+ SECONDARY: 2
+ RECOVERING: 3
+ STARTUP2: 5
+ UNKNOWN: 6
+ ARBITER: 7
+ DOWN: 8
+ ROLLBACK: 9
+ REMOVED: 10
{%- endif %}