Hi!
I have a .net application which write log entries per nlog direct to Elasticsearch.
It works with strings, numbers and booleans.
Now I need to transfer a 'date' as structured log entry to Elasticsearch, but it will always just recognized as type 'keyword' doesn´t matter what format I choose.
For example:
logger.LogInformation("{mydate}",DateTime.Now.ToString("yyyy-MM-dd");
The only way it worked is when I write into elasticsearch console
PUT *myIndex*/_mapping
{
"properties": {
"mydate": {
"type": "date",
"format": "yyyy-MM-dd"
}
}
}
before I log the first entry from my application.
But this is not a good solution and I don´t see how I can automatically configurate this.
Any help whould be great!