Painless scripted field match

…衆ロ難τιáo~ 提交于 2019-12-02 17:52:42

问题


I'm struggling with Scripted Fields in Kibana.

I have created dataframe which contains data grouped by num1:

             timestamp           num1         suffix
Jul 23, 2019 @ 11:24:18.000 1563866656871111    dn
Jul 23, 2019 @ 11:24:18.000 1563866656872222    dn
Jul 23, 2019 @ 11:24:18.000 1563866656876839    dn
Sep 4, 2019  @ 15:24:18.000 1563866656878888    dn
Jul 26, 2019 @ 19:44:18.000 1563867854323333    dn
Jul 26, 2019 @ 19:44:18.000 1563867854324841    dn
Jul 4, 2019  @ 15:56:17.000 1562241377271986    mt
Jul 4, 2019  @ 15:56:17.000 1562241377327366    mt
Jul 4, 2019  @ 15:56:17.000 1562241377361430    mt
Jul 4, 2019  @ 15:56:17.000 1562241377394376    mt
Jul 23, 2019 @ 11:24:16.000 1563866656871111    mt
Jul 23, 2019 @ 11:24:16.000 1563866656876839    mt
Sep 4, 2019  @ 15:24:16.000 1563866656878888    mt
Jul 26, 2019 @ 19:44:14.000 1563867854324841    mt
Jul 26, 2019 @ 19:44:14.000 1563867854325555    mt

I need to create scripted field state that can take num1 field, compare if num1 has both suffices 'mt' and 'dn' and if it has it'll say good if not it'll say bad.

I'm trying to marge fields num1 and suffix with the following code:

doc['num1.keyword'].value + ':' + doc['suffix.keyword'].value;

And then somehow match if the same number has both suffices behind the colon ':' .

Does anyone have any idea how to achieve it?

Any help would be really appreciated!!

来源:https://stackoverflow.com/questions/58391273/painless-scripted-field-match

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!