-
|
Can the elasticsearch-logger plugin index index concatenate the current date? |
Beta Was this translation helpful? Give feedback.
Answered by
dosubot[bot]
Sep 19, 2024
Replies: 1 comment 6 replies
-
|
Yes, the {
"plugins": {
"elasticsearch-logger": {
"endpoint_addrs": ["http://127.0.0.1:9200"],
"field": {
"index": "services-$time_iso8601",
"type": "collector"
},
"auth": {
"username": "elastic",
"password": "123456"
},
"ssl_verify": false,
"timeout": 60,
"retry_delay": 1,
"buffer_duration": 60,
"max_retry_count": 0,
"batch_max_size": 1000,
"inactive_timeout": 5,
"name": "elasticsearch-logger"
}
},
"upstream": {
"type": "roundrobin",
"nodes": {
"127.0.0.1:1980": 1
}
},
"uri": "/elasticsearch.do"
}In this example, the |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
guoqqqi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, the
elasticsearch-loggerplugin can concatenate the current date to the index. You can use Nginx variables to achieve this. For example, you can set thefield.indexattribute to include the current date:{ "plugins": { "elasticsearch-logger": { "endpoint_addrs": ["http://127.0.0.1:9200"], "field": { "index": "services-$time_iso8601", "type": "collector" }, "auth": { "username": "elastic", "password": "123456" }, "ssl_verify": false, "timeout": 60, "retry_delay": 1, "buffer_duration": 60, "m…