Skip to content

Instantly share code, notes, and snippets.

@sabuhish
Last active October 4, 2021 06:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sabuhish/c6174dbc082d3166826391f99cccdd69 to your computer and use it in GitHub Desktop.
Save sabuhish/c6174dbc082d3166826391f99cccdd69 to your computer and use it in GitHub Desktop.
GET /_cat/indices?v
GET /_cat/indices?h=index
GET logstash-*/_settings
GET .kibana_1/_settings
GET /_ingest/pipeline
GET /_ingest/pipeline/xpack_monitoring_6
GET logstash-*/_search?size=10000
{
"query": {
"match_all": {}
}
}
POST logstash-2021.10.02/_delete_by_query?conflicts=proceed
{
"query": {
"match_all": {}
}
}
DELETE logstash-2021.10.01
GET _cat/templates
GET _cat/aliases?v
GET _cat/indices?v
GET logstash-*/_mapping
GET logstash-*/_settings
GET /_template
GET _index_template/daily_logs
GET _ingest/pipeline/logstash_pipeline
PUT _ingest/pipeline/log-pipeline
{
"description": "Drop documents that contain log of health and readiness",
"processors": [
{
"drop": {
"if": "ctx.log.contains('health')"
}
},
{
"drop": {
"if": "ctx.log.contains('readiness')"
}
},
{
"drop": {
"if": "ctx.log.contains('http://127.0.0.1:5601/app/kibana')"
}
},
{
"drop": {
"if": "ctx.log.contains('http://127.0.0.1:5601')"
}
}
]
}
GET _ingest/pipeline/logstash_pipeline
POST _ingest/pipeline/logstash_pipeline/_simulate
{
"docs": [
{
"_source": {
"log": "text readiness health"
}
}
]
}
PUT foo/_doc?pipeline=logstash_pipeline
{
"log": "123"
}
POST logstash-2021.10.02/_doc/2?pipeline=log-pipeline
{"log": "2021-10-01 18:51:43,130 loglevel=INFO logger=root log_requests() L40 RID=I8G6DG START REQUEST PATH=/transactions-service/v1/readiness METHOD=GET "}
GET my-index/_search?size=1000
{
"query": {
"match_all": {}
}
}
GET logstash-2021.10.02/_doc/1
{
"query": {
"match_all": {}
}
}
PUT _template/logstash-custom-template
{
"index_patterns": ["logstash-*"],
"settings": {
"index": {
"default_pipeline": "log-pipeline"
}
}
}
GET _template/logstash-custom-template
----------------------------------------------------------
GET _ilm/policy
Rotation Policy:
PUT _ilm/policy/logstash-ilm-policy
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": {
"max_age": "20d"
}
}
},
"warm": {
"min_age": "40d",
"actions": {
"set_priority": {
"priority": 50
}
}
},
"cold": {
"min_age": "60d",
"actions": {
"set_priority": {
"priority": 0
}
}
},
"delete": {
"min_age": "80d",
"actions": {
"delete": {}
}
}
}
}
}
GET _ilm/policy/logstash-ilm-policy
PUT _template/logstash-policy-template
{
"index_patterns": [
"logstash-*"
],
"settings": {
"index": {
"lifecycle.name": "logstash-ilm-policy"
}
}
}
GET _template/logstash-policy-template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment