Do you need to work with Elasticsearch and you have no idea about how to use this database? Remember that Elasticsearch can be used through a REST API using simple curl commands. Here you have some tips:
You can replace localhost
with https://search-flowup-ui67d3e2wfxfwzmycdfxxkelfy.eu-west-1.es.amazonaws.com
to access our production environment but you will need to launch an instance from Amazon EC2.
curl -XPOST http://localhost:9000/report -H 'Content-Type: application/json;charset=UTF-8' -H 'X-Api-Key: YOUR_API_KEY' -H 'X-UUID: 9c2a2994-b2b9-4297-81eb-231984ad056e' -d @test/resources/reportRequest.json
You can start a FlowUp instance, register a user and get an API key before to send this request.
curl -XPOST 'localhost:9200/INDEX_NAME/TYPE -d ANY_JSON}
or
curl -XPOST 'localhost:9200/INDEX_NAME/TYPE -d @ANY_PATH_TO_ANY_JSON_FILE}
Here you have two examples.
Using raw json:
curl -XPOST 'localhost:9200/website/blog' -H 'Content-Type: application/json' -d
'{
"title": "My second blog entry",
"text": "Still trying this out...",
"date": "2014/01/01"
}'
Using any file as body:
curl -XPOST http://localhost:9200/installations/counter -d @test/resources/installationscounter/incrementInstallationsCounter.json
curl -XDELETE http://localhost:9200/installations/
curl 'localhost:9200/_cat/indices?v'
curl 'localhost:9200/<any_index>'
curl 'localhost:9200/installationscounter/_search?q=apiKey:ba49d1c5c531481ca2420ba0254d377e'
curl -v -XGET -d '{ "fields" : ["_id"], "query": { "range": { "@timestamp": { "lte": "now-90d" } } } }' 'localhost:9200/_search?size=1&pretty=true'
curl -v -XGET -d '{ "fields" : ["_id"], "query": { "range": { "@timestamp": { "lte": "now-90d" } } } }' 'localhost:9200/INDEX_NAME/DOCUMENT_NAME/_search?size=1&pretty=true'
curl -v -XPOST -d ' {"delete": { "_index": "INDEX_NAME", "_type": "DOCUMENT", "_id": "ID"}} {"delete": { "_index": "INDEX_NAME_2", "_type": "DOCUMENT_2", "_id": "ID_2"}}' 'localhost:9200/_bulk'
curl -v -XPOST --data-binary "@bulkJson" 'localhost:9200/_bulk'
curl -XDELETE 'localhost:9200/INDEX_NAME'