Created
December 12, 2011 15:48
-
-
Save kbarber/1467956 to your computer and use it in GitHub Desktop.
elasticsearch queries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Searching for apache-access logs: | |
curl -XGET 'http://localhost:9200/logstash-2011.12.09/_search?q=response:200&pretty=true' | less | |
Turning on compression: | |
curl -XPUT localhost:9200/_settings -d '{ | |
"_source" : {"compress" : true} | |
}' | |
curl -XPUT localhost:9200/_settings -d '{ | |
"logstash-2011.12.12" : { | |
"_source" : {"compress" : true} | |
} | |
}' | |
Setting a template: | |
curl -XPUT localhost:9200/_template/logstash_1 -d ' | |
{ | |
"template" : "logstash*", | |
"settings" : { | |
"number_of_shards" : 1 | |
}, | |
"mappings" : { | |
"syslog" : { | |
"_source" : { "enabled" : false } | |
} | |
} | |
}' | |
curl -XPUT localhost:9200/_template/logstash_1 -d ' | |
{ | |
"template" : "logstash*", | |
"settings" : { | |
"number_of_shards" : 5 | |
}, | |
"mappings" : { | |
"*" : { | |
"_source" : { "compress" : true } | |
} | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment