I am generating custom logs formatted as single line JSON with Date fields and sending them to ES with Filebeat, however when the index and pattern is created, the date fields are Strings and numbers instead of Dates.
datetest.ps1
@{ Date = (Get-Date) } | ConvertTo-Json -Compress | Out-File -Encoding utf8 -Force -Append file.json
@{ ToFileTimeUtc = (Get-Date).ToFileTimeUtc() } | ConvertTo-Json -Compress | Out-File -Encoding utf8 -Force -Append file.json
@{ DateTime = (Get-Date).DateTime } | ConvertTo-Json -Compress | Out-File -Encoding utf8 -Force -Append file.json
file.json
{"Date":{"value":"\/Date(1565580667972)\/","DisplayHint":2,"DateTime":"Monday, August 12, 2019 1:31:07 PM"}}
{"ToFileTimeUtc":132100542679805620}
{"DateTime":"Monday, August 12, 2019 1:31:07 PM"}
How can i get Date Types into ES?