map 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. # If the # character is present, it will be replaced by the
  15. # MQTT topic name with the points converted to slashes
  16. n test/mosquitto/messages/load/received
  17. n test/mosquitto/messages/load/#
  18. n test/jp/j1
  19. n $SYS/broker/load/messages/received/1min test.mosquitto.messages.load.received
  20. n $SYS/broker/load/messages/sent/1min test.mosquitto.messages.load.sent
  21. # Will be sent to "homeautomation.sensor.temperature.bedroom"
  22. n sensor/temperature/bedroom homeautomation.#
  23. j test/jp/j2
  24. j test/jp/j3 test.jp.json
  25. # The last line above means, subscribe to the MQTT topic of "test/jp/jp3",
  26. # extract JSON, and translate the topic to a the "test.jp.json.___" key.
  27. # Submitting an MQTT message payload of
  28. #
  29. # { "size":69,"temp": 89.3, "gas": " 88", "name": "JP Mens" }
  30. #
  31. # will produce the following Carbon entries:
  32. #
  33. # test.jp.json.gas 88.000000 1363169729
  34. # test.jp.json.temp 89.300000 1363169729
  35. # test.jp.json.size 69.000000 1363169729
  36. s tele/wemos-sensor-1/SENSOR