map 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #(@)mqtt2graphite map file
  2. # Each line has two OR three values in it. Values MUST no contain white
  3. # space.
  4. # First value:
  5. # n payload contains a number (int or float) use that
  6. # j payload is JSON. Extract all keys with numeric values
  7. # Second value:
  8. # Subscribe to this channel. MQTT wildcards (#) are allowed.
  9. # Third (optional) value:
  10. # The MQTT topic is to be mapped to this key in Carbon (Graphite)
  11. # Use periods as separators, just like Carbon expects them. If
  12. # this value is not specified, the MQTT topic name will be used,
  13. # with slashes (/) converted to dots (.)
  14. n test/mosquitto/messages/load/received
  15. n test/mosquitto/messages/load/#
  16. n test/jp/j1
  17. n $SYS/broker/load/messages/received/1min test.mosquitto.messages.load.received
  18. n $SYS/broker/load/messages/sent/1min test.mosquitto.messages.load.sent
  19. j test/jp/j2
  20. j test/jp/j3 test.jp.json
  21. # The last line above means, subscribe to the MQTT topic of "test/jp/jp3",
  22. # extract JSON, and translate the topic to a the "test.jp.json.___" key.
  23. # Submitting an MQTT message payload of
  24. #
  25. # { "size":69,"temp": 89.3, "gas": " 88", "name": "JP Mens" }
  26. #
  27. # will produce the following Carbon entries:
  28. #
  29. # test.jp.json.gas 88.000000 1363169729
  30. # test.jp.json.temp 89.300000 1363169729
  31. # test.jp.json.size 69.000000 1363169729