I'm having the hardest time trying to figure out what i'm doing wrong here and hope that someone else has some pointers
I can run the following query in Dev Tools
POST _sql
{
"query": "SELECT agent.hostname AS HOST, timestamp AS TIME, round(TEMPERATURE_A,1) AS TEMP FROM \"test*\" WHERE agent.hostname = 'host-1-1' AND TEMP is not null AND TIME < NOW() AND TIME > NOW() - INTERVAL 250 MINUTES GROUP BY TIME,HOST,TEMP ORDER BY TIME,HOST DESC LIMIT 5"
}
but the curl command that it gives me to use
curl -XPOST "http://localhost:9200/_sql" -H 'Content-Type: application/json' -d'{ "query": "SELECT agent.hostname AS HOST, timestamp AS TIME, round(TEMPERATURE_A,1) AS TEMP FROM \"test*\" WHERE agent.hostname = \"host-1-1\" AND TEMP is not null AND TIME < NOW() AND TIME > NOW() - INTERVAL 250 MINUTES GROUP BY TIME,HOST,TEMP ORDER BY TIME,HOST DESC LIMIT 5"}'
results in an error. I'm confident its related to this part not being able to get parsed correctly:
agent.hostname = \"host-1-1\"
Depending on how I escape it, I get either an Unexpected character error or Found 1 problem(s)\nline 1:127: Unknown column [host-1-1]" but never the results I am looking for. I can query it the following way but its not optimal
./bin/elasticsearch-sql-cli -d http://user:password@localhost:9200 < test.sql
Anyone have any experience with something similar?