Hi,
My setup:
Kibana 5.6.2
ES 5.6.2
Need some help to extract the SIM number from the path field in a document
The field value:
C:/HWM/Apps/CAR/Export/971XXXXXX231_20180903.CSV
I need to fetch only the value 971XXXXXX231 as a result for the below mentioned scripted field.
Here is my attempt using the examples mentioned in scripted help
def logger= doc['path.keyword'].value;
if (logger!= null) {
int lastSlashIndex = logger.lastIndexOf('/');
if (lastSlashIndex > 0) {
return logger.substring(lastSlashIndex+1);
}
}
return "";
But the result is 971XXXXXX231_20180903.CSV