Is it possible to create a long scripted field from a string field?

Hi,

I am using ELK GA 6.3.0. In my index, I have a field called duration. It is mapped as String type. I would like to do some mathematical operations and would like to create a field duration_b having datatype long. Is this possible? How can I do this?

Thanks.

Solved it using;

return Long.parseLong(doc['duration.keyword'].value);

Is this correct procedure?

Yeah, that's exactly how you would want to do it :slight_smile:

1 Like

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