Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -x
- curl -X DELETE 'http://localhost:9200/test-foo?pretty'
- curl -X PUT 'http://localhost:9200/_template/test?pretty' -d '
- {
- "template": "test-*",
- "mappings" : {
- "traces" : {
- "properties": {
- "@timestamp": {"type": "date" },
- "start_time": {"type": "date" }
- }
- }
- }
- }'
- curl -X POST 'http://localhost:9200/test-foo/traces?pretty' -d '
- {
- "@timestamp": "2015-03-29T12:22:11.996306+0000",
- "start_time": 1427631731
- }'
- sleep 1
- curl -X GET 'http://localhost:9200/test-foo/_search?pretty' -d '
- {
- "query": {
- "range": { "start_time": { "gte": "2015-03" } }
- }
- }'
- # ==> no hit
- curl -X GET 'http://localhost:9200/test-foo/_search?pretty' -d '
- {
- "query": {
- "range": { "@timestamp": { "gte": "2015-03" } }
- }
- }'
- # ==> finds indexed doc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement