How to use scripted fields, very basics


I am trying to understand how to use scripted fields (the basics of it), using date field and I am unsuccessful.

I saw a lot of 'painless' code in the format as inside this link, but they are all in PUT GET format and I don't know what to put inside the box of script in the Kibana what format belongs there:

my end result is to subtract date X by date Y.

Found this and it works:

def dateFormat = new SimpleDateFormat("ss");
    return dateFormat.format(doc['medGotAck_MT.raw'].value - doc['MedGotMsgFromApi.raw'].value);

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