Skip to content

Instantly share code, notes, and snippets.

View dadoonet's full-sized avatar
🇪🇺
From Europe with ❤️

David Pilato dadoonet

🇪🇺
From Europe with ❤️
View GitHub Profile
curl -XDELETE 'http://localhost:9200/logstash-2013.12.20/'; echo
curl -XPOST 'http://localhost:9200/logstash-2013.12.20/cloudtest' -d '
{
"responseElements": {
"instancesSet": {
"items": [
{
"instanceId": "i-1bbb1111",
"currentState": {
# Delete the index `testindex`
curl -XDELETE 'http://localhost:9200/test' ; echo
# Create the index `testindex`
curl -XPUT 'http://localhost:9200/test' -d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
},
curl -XDELETE "http://localhost:9200/test"; echo
curl -XPUT "http://localhost:9200/test" -d'
{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"analysis": {
"analyzer": {
@dadoonet
dadoonet / facet_ip.sh
Created December 5, 2013 07:56
Facet on IP address V4
curl -XPOST http://localhost:9200/foo; echo
curl -XPUT http://localhost:9200/foo/bar/_mapping -d '{
"bar":{
"properties":{
"clientip":{
"type":"multi_field",
"fields":{
"clientip":{
"type":"ip"
@dadoonet
dadoonet / version_actual.sh
Last active December 29, 2015 17:29
Related to issue: https://github.com/elasticsearch/elasticsearch/issues/4300 Version number could appear as inconsistent
curl -XDELETE "http://localhost:9200/myindex"; echo
curl -XPUT "http://localhost:9200/myindex" -d'
{
"settings": {
"gc_deletes": "30s"
}
}'; echo
curl -XPUT "http://localhost:9200/myindex/doc/1" -d'{ "foo" : "bar" }'; echo
curl -XDELETE "http://localhost:9200/myindex/doc/1?version=1"; echo
curl -XPUT "http://localhost:9200/myindex/doc/1?version=2" -d'{ "foo" : "bar" }'; echo
curl -XDELETE "http://localhost:9200/anindex"; echo
curl -XPUT "http://localhost:9200/anindex/atype/1" -d'
{
"obj1":
{
"foo" : "bar"
},
"obj2" :
{
"baz" : "qux"
@dadoonet
dadoonet / script.sh
Created November 28, 2013 10:35
Test doc field existence in elasticsearch facet script
curl -XDELETE "http://localhost:9200/script/"
curl -XPUT "http://localhost:9200/script/doc/1" -d'
{
"title":"test"
}'
curl -XPUT "http://localhost:9200/script/doc/2?refresh" -d'
{
"title":"nothing",
@dadoonet
dadoonet / bluekiwi.sh
Created November 8, 2013 17:21
Bluekiwi example
curl -XDELETE "http://localhost:9200/bluekiwi"; echo
curl -XPUT "http://localhost:9200/bluekiwi/doc/1" -d'
{
"group":1,
"title":"test",
"content":"nothing",
"tags":["tag1","tag2"],
"authorId":1,
"creatorId":1
@dadoonet
dadoonet / logstash.conf
Created September 13, 2013 07:35
logstash configuration example for elasticsearch logs
# This is a comment. You should use comments to describe
# parts of your configuration.
input {
file {
type => "server02"
path => [ "/tmp/server02/*.log*" ]
}
file {
type => "server03"
path => [ "/tmp/server03/*.log*" ]
@dadoonet
dadoonet / azure.md
Created September 5, 2013 11:40
Create Azure instance
# Create the first VM
azure vm create azure-elasticsearch-cluster \
                b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-20130808-alpha3-en-us-30GB \
                --vm-name myesnode1 \
                --location "West Europe" \
                --vm-size extrasmall \
                --ssh 22 \
                --ssh-cert /tmp/azure-certificate.pem \
 elasticsearch password