Skip to content

Instantly share code, notes, and snippets.

@mayvazyan
Forked from mivano/logstash
Last active January 13, 2016 04:02
Show Gist options
  • Save mayvazyan/cf645f1c9cbbec97cc45 to your computer and use it in GitHub Desktop.
Save mayvazyan/cf645f1c9cbbec97cc45 to your computer and use it in GitHub Desktop.
curl -XPUT http://localhost:9200/logstash?pretty -d '{
"template": "logstash*",
"settings": {
"index.refresh_interval": "5s"
},
"mappings": {
"_default_": {
"_all": {
"enabled": true,
"omit_norms": true
},
"dynamic_templates": [
{
"numerics_in_fields": {
"path_match": "fields\\.[\\d+]$",
"match_pattern": "regex",
"mapping": {
"type": "string",
"index": "analyzed",
"omit_norms": true
}
}
},
{
"string_fields": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"index": "analyzed",
"omit_norms": true,
"fields": {
"raw": {
"type": "string",
"index": "not_analyzed",
"ignore_above": 256
}
}
}
}
}
],
"properties": {
"message": {
"type": "string",
"index": "analyzed"
},
"@timestamp": {
"index": "not_analyzed",
"type": "date"
},
"level": {
"index": "not_analyzed",
"type": "string"
},
"messageTemplate": {
"index": "analyzed",
"type": "string"
},
"exceptions": {
"type": "nested",
"properties": {
"Depth": {
"type": "integer"
},
"RemoteStackIndex": {
"type": "integer"
},
"HResult": {
"type": "integer"
},
"StackTraceString": {
"type": "string",
"index": "analyzed"
},
"RemoteStackTraceString": {
"type": "string",
"index": "analyzed"
},
"ExceptionMessage": {
"type": "object",
"properties": {
"MemberType": {
"type": "integer"
}
}
}
}
}
}
}
}
}'
cd /opt/
sudo wget https://raw.githubusercontent.com/imperialwicket/elasticsearch-logstash-index-mgmt/master/elasticsearch-remove-old-indices.sh
sudo crontab -e
# 00 9 * * * root /bin/bash /opt/elasticsearch-remove-old-indices.sh
sudo nano /etc/elasticsearch/elasticsearch.yml
# network.host: 0.0.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment