Reputation: 13
I use elk for logging in asp.net app. But, I see in kibana that logstash create new index every day, for example logstash-2019-04-26, logstash-2019-04-27, logstash-2019-04-28. How to make was a single index? If this important, elk run in docker on vps server and code for setup logging:
var logger = new LoggerConfiguration()
.WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri("http://my_server:9200"))
{
ModifyConnectionSettings = x => x.SetBasicAuthentication(username, password);
})
.CreateLogger();
Upvotes: 1
Views: 1041
Reputation: 21
You can decide the index name in the output configuration. Example:
output {
amazon_es {
hosts => ["vpc-xxx-es-yyy.us-east-1.es.amazonaws.com"]
region => "us-east-1"
aws_access_key_id => '<KEY>'
aws_secret_access_key => '<SECRETKEY>'
index => "indexnamestatic"
}
}
Upvotes: 0
Reputation: 69
Use a static index name in the logstash output plugin elasticsearch, with the index option, replacing "logstash-%{+YYYY.MM.dd}"
by any static name.
Upvotes: 2