Skip to content

Commit 71b094d

Browse files
author
Dale McDiarmid
committed
5.0 Updates for apache demo
1 parent 4eca897 commit 71b094d

6 files changed

Lines changed: 28 additions & 33 deletions

File tree

ElasticStack_apache/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
### Getting Started with ELK for Apache Logs
2-
This **Getting Started with ELK** example provides sample files to ingest, analyze & visualize **Apache Access Logs** using the ELK stack, i.e. Elasticsearch, Logstash and Kibana. The sample logs in this example are in the default apache combined log format.
1+
### Getting Started with Elastic Stack for Apache Logs
2+
This **Getting Started with Elastic Stack** example provides sample files to ingest, analyze & visualize **Apache Access Logs** using the Elastic Stack, i.e. Elasticsearch, Logstash and Kibana. The sample logs in this example are in the default apache combined log format.
33

44
##### Version
55
Example has been tested in following versions:
6-
- Elasticsearch 2.0
7-
- Logstash 2.0
8-
- Kibana 4.2.0
6+
- Elasticsearch 5.0
7+
- Logstash 5.0
8+
- Kibana 5.0
99

1010
### Installation & Setup
11-
* Follow the [Installation & Setup Guide](https://github.com/elastic/examples/blob/master/Installation%20and%20Setup.md) to install and test the ELK stack (*you can skip this step if you have a working installation of the ELK stack,*)
11+
* Follow the [Installation & Setup Guide](https://github.com/elastic/examples/blob/master/Installation%20and%20Setup.md) to install and test the Elastic Stack (*you can skip this step if you have a working installation of the Elastic Stack,*)
1212

1313
* Run Elasticsearch & Kibana
1414
```shell
@@ -52,17 +52,17 @@ cat apache_logs | <path_to_logstash_root_dir>/bin/logstash -f apache_logstash.co
5252

5353
* Verify that data is succesfully indexed into Elasticsearch
5454

55-
Running `http://localhost:9200/apache_elk_example/_count` should return a response a `"count":10000`
55+
Running `http://localhost:9200/apache_elastic_example/_count` should return a response a `"count":10000`
5656

5757
**Note:** Included `apache_logstash.conf` configuration file assumes that you are running Elasticsearch on the same host as Logstash and have not changed the defaults. Modify the `host` and `cluster` settings in the `output { elasticsearch { ... } }` section of apache_logstash.conf, if needed.
5858
5959
##### 2. Visualize data in Kibana
6060
6161
* Access Kibana by going to `http://localhost:5601` in a web browser
62-
* Connect Kibana to the `apache_elk_example` index in Elasticsearch (autocreated in step 1)
63-
* Click the **Settings** tab >> **Indices** tab >> **Create New**. Specify `apache_elk_example` as the index pattern name and click **Create** to define the index pattern. (Leave the **Use event times to create index names** box unchecked)
62+
* Connect Kibana to the `apache_elastic_example` index in Elasticsearch (autocreated in step 1)
63+
* Click the **Management** tab >> **Index Patterns** tab >> **Create New**. Specify `apache_elastic_example` as the index pattern name and click **Create** to define the index pattern. (Leave the **Use event times to create index names** box unchecked and use @timestamp as the Time Field)
6464
* Load sample dashboard into Kibana
65-
* Click the **Settings** tab >> **Objects** tab >> **Import**, and select `apache_kibana.json`
65+
* Click the **Management** tab >> **Saved Objects** tab >> **Import**, and select `apache_kibana.json`
6666
* Open dashboard
6767
* Click on **Dashboard** tab and open `Sample Dashboard for Apache Logs` dashboard
6868
598 KB
Loading
-1.72 MB
Binary file not shown.

ElasticStack_apache/apache_kibana.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"description": "",
2626
"version": 1,
2727
"kibanaSavedObjectMeta": {
28-
"searchSourceJSON": "{\"index\":\"apache_elk_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
28+
"searchSourceJSON": "{\"index\":\"apache_elastic_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
2929
}
3030
}
3131
},
@@ -51,7 +51,7 @@
5151
"description": "",
5252
"version": 1,
5353
"kibanaSavedObjectMeta": {
54-
"searchSourceJSON": "{\"index\":\"apache_elk_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[{\"meta\":{\"index\":\"apache_elk_example\",\"key\":\"response\",\"value\":\"200\",\"disabled\":false,\"negate\":true,\"apply\":true},\"query\":{\"match\":{\"response\":{\"query\":200,\"type\":\"phrase\"}}}}]}"
54+
"searchSourceJSON": "{\"index\":\"apache_elastic_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[{\"meta\":{\"index\":\"apache_elastic_example\",\"key\":\"response\",\"value\":\"200\",\"disabled\":false,\"negate\":true,\"apply\":true},\"query\":{\"match\":{\"response\":{\"query\":200,\"type\":\"phrase\"}}}}]}"
5555
}
5656
}
5757
},
@@ -64,7 +64,7 @@
6464
"description": "",
6565
"version": 1,
6666
"kibanaSavedObjectMeta": {
67-
"searchSourceJSON": "{\"index\":\"apache_elk_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[{\"meta\":{\"index\":\"apache_elk_example\",\"key\":\"useragent.device.raw\",\"value\":\"Other\",\"disabled\":false,\"negate\":true,\"apply\":true},\"query\":{\"match\":{\"useragent.device.raw\":{\"query\":\"Other\",\"type\":\"phrase\"}}}},{\"meta\":{\"index\":\"apache_elk_example\",\"key\":\"useragent.device.raw\",\"value\":\"Spider\",\"disabled\":false,\"negate\":true,\"apply\":true},\"query\":{\"match\":{\"useragent.device.raw\":{\"query\":\"Spider\",\"type\":\"phrase\"}}}}]}"
67+
"searchSourceJSON": "{\"index\":\"apache_elastic_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[{\"meta\":{\"index\":\"apache_elastic_example\",\"key\":\"useragent.device.raw\",\"value\":\"Other\",\"disabled\":false,\"negate\":true,\"apply\":true},\"query\":{\"match\":{\"useragent.device.raw\":{\"query\":\"Other\",\"type\":\"phrase\"}}}},{\"meta\":{\"index\":\"apache_elastic_example\",\"key\":\"useragent.device.raw\",\"value\":\"Spider\",\"disabled\":false,\"negate\":true,\"apply\":true},\"query\":{\"match\":{\"useragent.device.raw\":{\"query\":\"Spider\",\"type\":\"phrase\"}}}}]}"
6868
}
6969
}
7070
},
@@ -77,7 +77,7 @@
7777
"description": "",
7878
"version": 1,
7979
"kibanaSavedObjectMeta": {
80-
"searchSourceJSON": "{\"index\":\"apache_elk_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[{\"meta\":{\"index\":\"apache_elk_example\",\"key\":\"useragent.os.raw\",\"value\":\"Other\",\"disabled\":false,\"negate\":true,\"apply\":true},\"query\":{\"match\":{\"useragent.os.raw\":{\"query\":\"Other\",\"type\":\"phrase\"}}}}]}"
80+
"searchSourceJSON": "{\"index\":\"apache_elastic_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[{\"meta\":{\"index\":\"apache_elastic_example\",\"key\":\"useragent.os.raw\",\"value\":\"Other\",\"disabled\":false,\"negate\":true,\"apply\":true},\"query\":{\"match\":{\"useragent.os.raw\":{\"query\":\"Other\",\"type\":\"phrase\"}}}}]}"
8181
}
8282
}
8383
},
@@ -90,7 +90,7 @@
9090
"description": "",
9191
"version": 1,
9292
"kibanaSavedObjectMeta": {
93-
"searchSourceJSON": "{\"index\":\"apache_elk_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
93+
"searchSourceJSON": "{\"index\":\"apache_elastic_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
9494
}
9595
}
9696
},
@@ -103,7 +103,7 @@
103103
"description": "",
104104
"version": 1,
105105
"kibanaSavedObjectMeta": {
106-
"searchSourceJSON": "{\"index\":\"apache_elk_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
106+
"searchSourceJSON": "{\"index\":\"apache_elastic_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
107107
}
108108
}
109109
},
@@ -116,7 +116,7 @@
116116
"description": "",
117117
"version": 1,
118118
"kibanaSavedObjectMeta": {
119-
"searchSourceJSON": "{\"index\":\"apache_elk_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
119+
"searchSourceJSON": "{\"index\":\"apache_elastic_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
120120
}
121121
}
122122
},
@@ -129,7 +129,7 @@
129129
"description": "",
130130
"version": 1,
131131
"kibanaSavedObjectMeta": {
132-
"searchSourceJSON": "{\"index\":\"apache_elk_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
132+
"searchSourceJSON": "{\"index\":\"apache_elastic_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
133133
}
134134
}
135135
},
@@ -142,7 +142,7 @@
142142
"description": "",
143143
"version": 1,
144144
"kibanaSavedObjectMeta": {
145-
"searchSourceJSON": "{\"index\":\"apache_elk_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
145+
"searchSourceJSON": "{\"index\":\"apache_elastic_example\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
146146
}
147147
}
148148
}

ElasticStack_apache/apache_logstash.conf

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ filter {
2727

2828
output {
2929
stdout {
30-
codec => plain { charset => "ISO-8859-1" }
30+
codec => dots {}
3131
}
32-
32+
3333
elasticsearch {
34-
hosts => "http://localhost:9200"
35-
index => "apache_elk_example"
34+
index => "apache_elastic_example"
3635
template => "./apache_template.json"
37-
template_name => "apache_elk_example"
36+
template_name => "apache_elastic_example"
3837
template_overwrite => true
3938
}
4039
}

ElasticStack_apache/apache_template.json

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22

3-
"template": "apache_elk_example",
3+
"template": "apache_elastic_example",
44
"settings": {
55
"index.refresh_interval": "5s"
66
},
@@ -10,9 +10,8 @@
1010
{
1111
"message_field": {
1212
"mapping": {
13-
"index": "analyzed",
1413
"omit_norms": true,
15-
"type": "string"
14+
"type": "text"
1615
},
1716
"match_mapping_type": "string",
1817
"match": "message"
@@ -21,14 +20,12 @@
2120
{
2221
"string_fields": {
2322
"mapping": {
24-
"index": "analyzed",
2523
"omit_norms": true,
26-
"type": "string",
24+
"type": "text",
2725
"fields": {
2826
"raw": {
29-
"index": "not_analyzed",
3027
"ignore_above": 256,
31-
"type": "string"
28+
"type": "keyword"
3229
}
3330
}
3431
},
@@ -48,8 +45,7 @@
4845
"type": "object"
4946
},
5047
"@version": {
51-
"index": "not_analyzed",
52-
"type": "string"
48+
"type": "keyword"
5349
}
5450
},
5551
"_all": {

0 commit comments

Comments
 (0)