/influxparser

Influx line parser in ruby

Primary LanguageRuby

influxparser

This gem parses InfluxDB line protocol into a usable Ruby hash map. It exists primarily to support logstash-filter-influxdb but is a separate gem for anyone who needs it.

Pull reqeusts are welcome. The tests are based on the influx docs but there are plenty more tests that need to be written.

The official influxdb ruby gem supports encoding so I didn't bother.

usage

InfluxParser.parse_point('weather,location=us-midwest temperature="too warm" 1465839830100400200')

options

The second parameter for parse_point is a hash array of options. The current options are

  • :parse_types: Parse data types to ruby types (float, int, bool). If false all values in the fields are treated as strings.

    • default: false
  • :time_format: Parses the timestamp attribute (if present) and formats it accoring to a strftime format. InfluxDB time is always UTC so is this.

    • default: nil