HI team,
I have to extract substring(some file name) from long log message in a index.
I am trying toi create a scripted filed for extracting substring(file name) from long file using below painless script but its not giving any filename infact lank value coming.
Example-
log_text-20200323SSWaterfallTran20.csvFile Uploaded for sourcecisoAccuireblanksource1
I have to create new scripted field in index with value as -20200323SSWaterfallTran20
painless script using:
def m = /.*csv/.matcher(doc["log"].value); if ( m.matches() ) { return m.group(1) } else { return"" }
Thanks
Sarvendra