Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

Commit

Permalink
#15 import elk-elasticsearch from de-ansible/vmlab
Browse files Browse the repository at this point in the history
  • Loading branch information
donsizemore committed Mar 14, 2016
1 parent 927cd12 commit bcb0eac
Show file tree
Hide file tree
Showing 12 changed files with 999 additions and 0 deletions.
56 changes: 56 additions & 0 deletions ansible/roles/elk-elasticsearch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
elk-elasticsearch
=================

This role deploys the elastic search instance for the DE ELK stack.
The ELK stack refers to the use of ElasticSearch, Kibana, and Logstash together.


Requirements
------------

systemd

Role Variables
--------------
dockerHostStats_url: the location of the latest `dockerHostStats` file from Jenkins.

Role Tags
---------

config: deploys all config files.
stop_services: stops all services
update_service_files: updates all service files. CentOS 7, systemd files.
restart_services: restarts all services.

stop_elasticsearch: stops the elasticsearch service. CentOS 7 only.
stop_kibana: stops the kibana service. CentOS 7 only.
stop_logstash: stops the logstash service. CentOS 7 only.
restart_data: resarts the data container service. CentOS 7 only.
restart_elasticsearch: restarts the elasticsearch service. CentOS 7 only.
restart_kibana: restarts the kibana service. CentOS 7 only.
restart_logstash: restarts the logstash service. CentOS 7 only.

Dependencies
------------
N/A

Example Playbook
----------------

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: elk
roles:
- { role: elk-stack }

License
-------

BSD

Author Information
------------------

Jonathan Strootman - [email protected]


3 changes: 3 additions & 0 deletions ansible/roles/elk-elasticsearch/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
# defaults file for elk-elasticsearch
enable_services: yes
12 changes: 12 additions & 0 deletions ansible/roles/elk-elasticsearch/files/de-error-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"template": "de-error-logs-*",
"order": 2,
"settings": {
"index.refresh_interval": "5s",
"index.number_of_replicas": "0"
},
"aliases": {
"de-error-logs": {}
}
}

12 changes: 12 additions & 0 deletions ansible/roles/elk-elasticsearch/files/de-logs-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"template": "de-logs-*",
"order": 2,
"settings": {
"index.refresh_interval": "5s",
"index.number_of_replicas": "0"
},
"aliases": {
"de-logs": {}
}
}

121 changes: 121 additions & 0 deletions ansible/roles/elk-elasticsearch/files/de-metrics-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"template": "de-metrics-*",
"order": 1,
"settings": {
"index.refresh_interval": "5s",
"index.number_of_replicas": "0"
},
"mappings": {
"app_event": {
"properties": {
"app": {
"type": "nested",
"include_in_parent": true,
"properties": {
"id": {
"type": "string",
"index": "not_analyzed"
},
"name": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"integrator_name": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"description": {
"type": "string",
"index": "analyzed"
},
"step_count": {
"type": "integer"
}
}
},
"analysis": {
"type": "nested",
"include_in_parent": true,
"properties": {
"id": {
"type": "string",
"index": "not_analyzed"
},
"name": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"output_dir": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
}
}
},
"request": {
"type": "nested",
"include_in_parent": true,
"properties": {
"path-info": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"uri": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"request-method": {
"type": "string",
"index": "analyzed"
}
}
},
"response": {
"type": "nested",
"include_in_parent": true,
"properties": {
"path-info": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"uri": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"request-method": {
"type": "string",
"index": "analyzed"
}
}
}
}
}
},
"aliases": {
"de-metrics": {}
}
}

180 changes: 180 additions & 0 deletions ansible/roles/elk-elasticsearch/files/de-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
{
"template": "de-*",
"order": 0,
"settings": {
"index.refresh_interval": "5s",
"index.number_of_replicas": "0"
},
"mappings": {
"_default_": {
"dynamic_templates": [
{
"message_field": {
"mapping": {
"index": "analyzed",
"omit_norms": true,
"type": "string"
},
"match_mapping_type": "string",
"match": "message"
}
},
{
"string_fields": {
"mapping": {
"index": "analyzed",
"omit_norms": true,
"type": "string"
},
"match_mapping_type": "string",
"match": "*"
}
}
],
"properties": {
"geoip": {
"dynamic": true,
"properties": {
"location": {
"type": "geo_point"
}
},
"type": "object"
},
"service": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"ext_service": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"exception": {
"type": "nested",
"include_in_parent": true,
"properties": {
"error-code": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
}
}
},
"user-info": {
"type": "nested",
"include_in_parent": true,
"properties": {
"user": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"email": { "type": "string", "index": "analyzed"},
"first-name": { "type": "string", "index": "analyzed"},
"las-name": { "type": "string", "index": "analyzed"}
}
},
"app": {
"type": "nested",
"include_in_parent": true,
"properties": {
"id": { "type": "string", "index": "not_analyzed"},
"name": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"integrator_name": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"description": { "type": "string", "index": "analyzed"},
"step_count": { "type": "integer"}
}
},
"analysis": {
"type": "nested",
"include_in_parent": true,
"properties": {
"id": {
"type": "string",
"index": "not_analyzed"
},
"name": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"output_dir": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
}
}
},
"request": {
"type": "nested",
"include_in_parent": true,
"properties": {
"path-info": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"uri": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"request-method": {
"type": "string",
"index": "analyzed"
},
"id": {
"type": "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
}

}
},
"response": {
"type": "nested",
"include_in_parent": true
}

},
"_all": {
"enabled": true,
"omit_norms": true
}
}
},
"aliases": { }
}

Loading

0 comments on commit bcb0eac

Please sign in to comment.