# Read metrics from NATS subject(s)
[[inputs.nats_consumer]]
  ## urls of NATS servers
  servers = ["nats://localhost:4222"]

  ## subject(s) to consume
  subjects = ["telegraf"]

  ## jetstream subjects
  jetstream_subjects = ["js_telegraf"]

  ## name a queue group
  queue_group = "telegraf_consumers"

  ## Number of metrics to buffer
  metric_buffer = 1024

  data_format = "xpath_json"
  xpath_native_types = true

  # Configuration matching the first (ENERGY) message
  [[inputs.nats_consumer.xpath]]
    metric_name = "/name"
    timestamp = "/timestamp"
    timestamp_format = "unix_ms"
    field_selection = "/fields/*"
    tag_selection = "/tags/*"