Skip to content
This repository was archived by the owner on Dec 14, 2022. It is now read-only.

Commit 25214fc

Browse files
author
Chris Wiechmann
committed
Adjusting index-names
1 parent a1f3173 commit 25214fc

File tree

5 files changed

+23
-22
lines changed

5 files changed

+23
-22
lines changed

elk-traffic-monitor-api/flows/trafficMonitorApi-circuitpath.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,19 +142,19 @@
142142
"name": "Define Index",
143143
"method": "Execute",
144144
"parameters": [
145-
{
146-
"name": "code",
147-
"type": "string",
148-
"value": "\"let index = 'logstash-openlog';\\n if(data.config.testElasticIndex) {\\n index = data.config.testElasticIndex;\\n }\\n return index;\"",
149-
"metaName": "code",
150-
"metaDescription": "A JavaScript function body. Supports `await` and returning promises"
151-
},
152145
{
153146
"name": "data",
154147
"type": "jsonpath",
155148
"value": "$",
156149
"metaName": "data",
157150
"metaDescription": "The value to apply as the `data` argument to the JavaScript code. For objects and arrays, `data` is passed by reference."
151+
},
152+
{
153+
"name": "code",
154+
"type": "string",
155+
"value": "\"let index = 'apigw-traffic-*';\\n if(data.config.testElasticIndex) {\\n index = data.config.testElasticIndex;\\n }\\n return index;\"",
156+
"metaName": "code",
157+
"metaDescription": "A JavaScript function body. Supports `await` and returning promises"
158158
}
159159
],
160160
"outputs": {

elk-traffic-monitor-api/flows/trafficMonitorApi-getinfo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
{
4848
"name": "code",
4949
"type": "string",
50-
"value": "\"let index = 'logstash-openlog';\\n //let index = 'getinfo_test_1688';\\n \\n if(data.config.testElasticIndex) {\\n index = data.config.testElasticIndex;\\n }\\n \\n return index;\"",
50+
"value": "\"let index = 'apigw-traffic-*';\\n //let index = 'getinfo_test_1688';\\n \\n if(data.config.testElasticIndex) {\\n index = data.config.testElasticIndex;\\n }\\n \\n return index;\"",
5151
"metaName": "code",
5252
"metaDescription": "A JavaScript function body. Supports `await` and returning promises"
5353
}

elk-traffic-monitor-api/flows/trafficMonitorApi-search.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
{
314314
"name": "code",
315315
"type": "string",
316-
"value": "\"let index = 'logstash-openlog';\\n if(data.config.testElasticIndex) {\\n index = data.config.testElasticIndex;\\n }\\n return index;\"",
316+
"value": "\"let index = 'apigw-traffic-*';\\n if(data.config.testElasticIndex) {\\n index = data.config.testElasticIndex;\\n }\\n return index;\"",
317317
"metaName": "code",
318318
"metaDescription": "A JavaScript function body. Supports `await` and returning promises"
319319
}

elk-traffic-monitor-api/flows/trafficMonitorApi-trace.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,19 +283,19 @@
283283
"name": "Define Index",
284284
"method": "Execute",
285285
"parameters": [
286-
{
287-
"name": "code",
288-
"type": "string",
289-
"value": "\"let index = 'logstash-trace';\\n if(data.config.testElasticIndex) {\\n index = data.config.testElasticIndex;\\n }\\n return index;\"",
290-
"metaName": "code",
291-
"metaDescription": "A JavaScript function body. Supports `await` and returning promises"
292-
},
293286
{
294287
"name": "data",
295288
"type": "jsonpath",
296289
"value": "$",
297290
"metaName": "data",
298291
"metaDescription": "The value to apply as the `data` argument to the JavaScript code. For objects and arrays, `data` is passed by reference."
292+
},
293+
{
294+
"name": "code",
295+
"type": "string",
296+
"value": "\"let index = 'apigw-traffic-trace-*';\\n if(data.config.testElasticIndex) {\\n index = data.config.testElasticIndex;\\n }\\n return index;\"",
297+
"metaName": "code",
298+
"metaDescription": "A JavaScript function body. Supports `await` and returning promises"
299299
}
300300
],
301301
"outputs": {

logstash/pipeline/pipeline.conf

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ filter {
5858
grok {
5959
match => { "message" => "%{LOGLEVEL:level}%{SPACE}(?<loggedDate>\d{2}\/.{3}\/\d{4}:\d{2}:\d{2}:\d{2}\.\d{3})%{SPACE}\[%{WORD:fluff}\:%{WORD:correlationId}\]\s*%{GREEDYDATA:body}" }
6060
}
61-
# Add trace-messages not related to a specific error to a generic trace index
62-
if([correlationId] == "000000000000000000000000") {
63-
mutate { add_field => { "[@metadata][indexkey]" => "general_trace" } }
64-
}
6561
date {
6662
# LoggedDate is provided like so 13/Jul/2020:15:26:35.108
6763
match => [ "loggedDate", "dd/MMM/yyyy:HH:mm:ss.SSS" ]
@@ -80,12 +76,17 @@ output {
8076
if [correlationId] == "000000000000000000000000" {
8177
elasticsearch {
8278
hosts => "elasticsearch1:9200"
83-
index => "openlog-general-%{+YYYY.MM.dd}"
79+
index => "apigw-trace-messages-%{+YYYY.MM.dd}"
80+
}
81+
} else if [logtype] == "trace" {
82+
elasticsearch {
83+
hosts => "elasticsearch1:9200"
84+
index => "apigw-traffic-trace-%{+YYYY.MM.dd}"
8485
}
8586
} else {
8687
elasticsearch {
8788
hosts => "elasticsearch1:9200"
88-
index => "apigw-%{logtype}-%{+YYYY.MM.dd}"
89+
index => "apigw-traffic-%{+YYYY.MM.dd}"
8990
#template => "${HOME}/config/openlog_index_template.json"
9091
template_overwrite => true
9192
document_id => "%{correlationId}"

0 commit comments

Comments
 (0)