3
votes

when sending data to statsd:

echo "foo:1|c" | nc -u -w0 127.0.0.1 8125

statsd will output the result after refresh and insert the data to influxDB:

{ counters: 
   { 'statsd.bad_lines_seen': 0,
     'statsd.packets_received': 1,
     'statsd.metrics_received': 1,
     foo: 1 },
  timers: {},
  gauges: { 'statsd.timestamp_lag': 0 },
  timer_data: {},
  counter_rates: 
   { 'statsd.bad_lines_seen': 0,
     'statsd.packets_received': 0.03333333333333333,
     'statsd.metrics_received': 0.03333333333333333,
     foo: 0.03333333333333333 },
  sets: {},
  pctThreshold: [ 90 ] }

run the command to show influxDB info:

$curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode "db=mydb" --data-urlencode "q=SHOW MEASUREMENTS"

will give the response successfully:

{
    "results": [
        {
            "series": [
                {
                    "name": "measurements",
                    "columns": [
                        "name"
                    ],
                    "values": [
                        [
                            "cpu_load_short"
                        ],
                        [
                            "foo.counter"
                        ]
                    ]
                }
            ]
        }
    ]
}

then I want to query the data from influxDB:

$curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode "db=mydb" --data-urlencode "q=SELECT value FROM foo.counter"

I get the Error message:

{
    "results": [
        {
            "error": "retention policy not found"
        }
    ]
}

Any ideas? influxDB : 0.9.3

2

2 Answers

8
votes

You did find the correct resolution, which is that any identifiers containing a period must be double-quoted. The original query parses as select * from the measurement "counter" from the retention policy "foo", thus the foo not found error.

0
votes

sorry, the query should be

$curl -G 'http://localhost:8086/query?pretty=true' --data-urlencode "db=mydb" --data-urlencode 'q=SELECT * FROM "foo.counter"'

put double quotes on "foo.counter", the error message doesn't help.