Searching for a scripted Date in custom format

I have a field named date which has current date in long format and I have added a scripted field called log date which converts long into human readable format.Is there any way to search for a date in Human readable format itself?Because when I search in that format it shows no result but when searched in long format it works.

Not in the way you want, no. From the docs: Index patterns has been renamed to data views. | Kibana Guide [8.11] | Elastic

Scripted field values are computed at query time so they aren’t indexed and cannot be searched.

So, if you really want to search that field, you need to store it in elasticsearch in the format that you want to search.

Thanks for your reply.In that case is there any way to store the scripted data in elasticsearch?

How is your data getting into Elasticsearch in the first place? In my opinion, that's where you should do the transformation, and store it in an appropriately typed field. If you're using one of Elastic's tools (such as logstash) to get the data into Elasticsearch, the tool should have some support for transforming data during ingest. But if it's coming from elsewhere, you'll probably have to figure out how to hack around whatever tool you're using.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.