11

I am not understanding the format needed to insert data.

Why doesn't test a=dog,b=0,c=nice work?

On the site, I see that <measurement>[,<tag-key>=<tag-value>...] <field-key>=<field-value>[,<field2-key>=<field2-value>...] is the format to follow.

I also am reading you can have 0-many tags (in the above example I have zero tags)

Not sure what I am violating or why the error I keep getting is {"error":"unable to parse 'test a=dog,b=0,c=nice': invalid boolean"}

Who said anything about a boolean!?

agenis
  • 8,069
  • 5
  • 53
  • 102
bagnina
  • 121
  • 1
  • 1
  • 6

2 Answers2

11

Try this,

test a="dog",b=0,c="nice" 
Sufiyan Ghori
  • 18,164
  • 14
  • 82
  • 110
Rugaloo
  • 121
  • 4
  • 2
    This works, but if strings need to be quoted, why are all the examples on the site with unquoted strings? – bagnina Jul 27 '16 at 17:21
  • 6
    Strings only need to be quoted when they're used as field values. The examples you've seen most likely are with tag values, which can only ever be strings, and hence do not need to be quoted. For example `test,a=dog,c=nice b=0` is perfectly acceptable because in that case both `a` and `c` are tags not field. – Michael Desa Jul 28 '16 at 22:01
  • 1
    In my shell script I had to use escaped double quotes inside of an interpolated string to make it work: `curl -ik -XPOST 'http://localhost:8086/write?db=foo' --data-binary "awesome_table test_id=\"${test_id}\",build_id=${build_id} ${failure_time}"` – sakovias Mar 24 '17 at 14:12
0

As Sakovias pointed, it seems that the strings need to be surrounded by double quotes, and the double quotes need to be escaped. It looks like if you build your query for the line protocol:

querydata = "measurementname,tag=sometag field1=345,field2=\"label\""
agenis
  • 8,069
  • 5
  • 53
  • 102