-
Notifications
You must be signed in to change notification settings - Fork 1
/
es-notes.txt
executable file
·28 lines (22 loc) · 1.61 KB
/
es-notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
loading into elasticsearch: index only allows filename chars. space is not allowed.
curl allows to define file to load with @
default port is 9200, can be set in config.yml
in theory type allows space but does not work with curl so forget it
update to new es: download and extract new version, copy over data dir, start
list indices: curl 'localhost:9200/_cat/indices?v'
get item: curl -XGET 'http://localhost:9200/session1/tweet/1'
bulk upload: curl -s -XPOST localhost:9200/_bulk --data-binary @FILENAME
delete index: curl -XDELETE 'http://localhost:9200/INDEXNAME/'
stats for docs in specific index: curl localhost:9200/INDEXNAME/_stats/docs/
index mappings (schema): curl -XGET 'http://localhost:9200/session1/_mapping'
type mappings: curl -XGET 'http://localhost:9200/INDEXNAME/_mapping/TYPENAME'
create mapping: curl -XPOST 'http://localhost:9200/INDEXNAME' --data-binary @FILENAME
get items: curl -XGET 'http://192.168.2.78:9200/session1/_search?pretty=true&q=*:*'
sometimes these commands might be shown as having “;echo” appended at the end.
this helps in providing a newline as the returned data has no trailing newline otherwise (which can be confusing..)
kibana: y-axis = sum of cpu_system, buckets = x-axis, date histogram/second, sub-aggregation=split-bars, terms, pid
psutil: cpu/process poll with interval makes you wait for the duration of interval
notes:
-have to create es schema myself to create epoch with data type "date"
-even with cygwin, these commands do not seem to work well on windows (curl)
-schema mapping commands at https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html