일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 28 | 29 | 30 |
Tags
- springboot
- Python
- token filter test
- query
- plugin
- ELASTIC
- docker
- licence delete curl
- zip 파일 암호화
- 파이썬
- Java
- TensorFlow
- MySQL
- API
- analyzer test
- Mac
- License
- license delete
- 차트
- high level client
- Test
- zip 암호화
- Elasticsearch
- aggs
- matplotlib
- sort
- aggregation
- 900gle
- flask
- Kafka
Archives
- Today
- Total
개발잡부
index template 본문
반응형
Elasticsearch :
PUT _component_template/component_template1
{
"template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
}
}
}
PUT _component_template/runtime_component_template
{
"template": {
"mappings": {
"runtime": {
"day_of_week": {
"type": "keyword",
"script": {
"source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
}
}
}
}
}
}
PUT _index_template/template_1
{
"index_patterns": ["te*", "bar*"],
"template": {
"settings": {
"number_of_shards": 1,
"number_of_replicas":0
},
"mappings": {
"_source": {
"enabled": true
},
"properties": {
"host_name": {
"type": "keyword"
},
"created_at": {
"type": "date",
"format": "EEE MMM dd HH:mm:ss Z yyyy"
}
}
},
"aliases": {
"mydata": { }
}
},
"priority": 500,
"composed_of": ["component_template1", "runtime_component_template"],
"version": 3,
"_meta": {
"description": "my custom"
}
}
index pattern 에 맞는 데이터 입력
POST test/_doc/1
{
"host_name": "localhost"
}
index meta data 확인
{
"version": 4,
"mapping_version": 1,
"settings_version": 1,
"aliases_version": 1,
"routing_num_shards": 1024,
"state": "open",
"settings": {
"index": {
"routing": {
"allocation": {
"include": {
"_tier_preference": "data_content"
}
}
},
"number_of_shards": "1",
"provided_name": "test",
"creation_date": "1634135526525",
"number_of_replicas": "0",
"uuid": "PvNGwN24Tpm454KGxGlbSA",
"version": {
"created": "7130499"
}
}
},
"mappings": {
"_doc": {
"runtime": {
"day_of_week": {
"type": "keyword",
"script": {
"source": "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))",
"lang": "painless"
}
}
},
"properties": {
"@timestamp": {
"type": "date"
},
"created_at": {
"format": "EEE MMM dd HH:mm:ss Z yyyy",
"type": "date"
},
"host_name": {
"type": "keyword"
}
}
}
},
"aliases": [
"mydata"
],
"primary_terms": {
"0": 1
},
"in_sync_allocations": {
"0": [
"i-GeIPcpRJusyzYNErecnQ"
]
},
"rollover_info": { },
"system": false,
"timestamp_range": {
"unknown": true
}
}
반응형
'ElasticStack > Elasticsearch' 카테고리의 다른 글
[es] function score Query (0) | 2021.12.20 |
---|---|
[es] plugin 4 - custom analyzer 사용 (0) | 2021.12.15 |
[es] plugin 3 - custom analyzer (0) | 2021.12.12 |
[es] Analyzer 01 (0) | 2021.12.08 |
[es] plugin 1 (mvn 설치) (0) | 2021.11.10 |
Comments