Last active
June 24, 2016 19:39
-
-
Save alexandervantrijffel/aef93e117073430a3da90074906c606a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
This results in Elasticsearch being installed in /usr/share/elasticsearch/ with its configuration files placed in /etc/elasticsearch and its init script added in /etc/init.d/elasticsearch. Kibana is installed in /opt/kibana | |
To make sure Elasticsearch starts and stops automatically with the Droplet, add its init script to the default runlevels with the command: | |
sudo update-rc.d elasticsearch defaults | |
default port: 9200 | |
POST /libary/books/1/_update | |
{ | |
"doc": { | |
"price" : 10 | |
} | |
} | |
GET /libary/books/1 | |
=> "found": false | |
"_id": "1" | |
PUT /library/books/1 | |
POST /library/books | |
POST /library/books/1 | |
POST /libary/books/_bulk | |
{ "index: {"_id":1}} | |
{ "index: {"_id":2}} | |
DELETE | |
GET /libary/books/_search | |
GET /libary/books/_search | |
{ | |
"query": { | |
"match": { | |
"title": "fox" | |
} | |
"match_phrase": { | |
"title": "quick dog" | |
} | |
} | |
} | |
Relevance: https://www.google.nl/search?hl=nl&q=relevance+intro+elastic+co&gws_rd=ssl | |
GET /libary/books/_search | |
{ | |
"query": { | |
"bool": { | |
"should": [ // of must | |
{ | |
"match": { | |
"title": | |
} | |
}, | |
{ | |
"match_phrase": { | |
"body", "the life" | |
} | |
}, | |
{ | |
"query":"fox" | |
"boost":5 | |
}, | |
{ | |
"match_phrase": { | |
"title": "quick dog" | |
} | |
} | |
} | |
}, | |
"highlight": { | |
"fields": { | |
"title: {} | |
} | |
} | |
} | |
Filtered query (faster than querying) | |
GET /libary/books/_search | |
{ | |
"query": { | |
"filtered": { | |
"query": { | |
"match" | |
}, | |
"filter": { | |
"range": { | |
"FIELD": { | |
"gte": 10, | |
"lte": 20 | |
} | |
} | |
} | |
] | |
GET /library/_mapping | |
mapping - map the fields you know and leave the rest dynamic | |
PUT /library/books_mapping | |
{ | |
"books": { | |
"properties": { | |
"english_field": { | |
"type": "string", // cannot be changed | |
"analyzer": "index" | |
} | |
} | |
} | |
} | |
https://www.elastic.co/guide/en/elasticsearch/guide/current/mapping-intro.html | |
https://www.elastic.co/guide/en/elasticsearch/guide/current/analysis-intro.html | |
curl -XGET localhost:9200/_cluster/health?pretty | |
Setup ELK stack: https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elk-stack-on-ubuntu-14-04 | |
Getting started: https://info.elastic.co/2016-03-AB-Test-Getting-Started-ES_Video.html?aliId=44309551 | |
Amsible+Tinc VPN: https://www.digitalocean.com/community/tutorials/how-to-use-ansible-and-tinc-vpn-to-secure-your-server-infrastructure | |
https://www.linkedin.com/pulse/operational-excellence-de-retail-nog-wel-mogelijk-ron-saraber?trk=hb_ntf_MEGAPHONE_ARTICLE_POST | |
Seq & serilog | |
http://localhost:5341/ | |
http://docs.getseq.net/ | |
Elastic | |
Kibana | |
logstash - https://www.elastic.co/guide/en/logstash/current/installing-logstash.html | |
http://steffen.sunlyng.net/post/dr-strangelog-or-how-i-learned-to-stop-worrying-and-love-the-logs1 | |
filebeat - https://www.elastic.co/products/beats/filebeat , https://www.elastic.co/blog/structured-logging-filebeat | |
other beats - winlogbeat, packetbeat: https://www.elastic.co/downloads/beats | |
influxdb - managing time series data at scale - https://influxdata.com/time-series-platform | |
logrus - https://github.com/Sirupsen/logrus | |
http://goconvey.co/ | |
splunk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment