How to use scripted fields, very basics


(tomer zaks) #1

Hi,

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.


(tomer zaks) #2

Found this and it works:

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

(system) #3

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