Regex can not match multiple line in painless

I want to catch some string in message field like that:

1600657611591|sendRequest_http10.20.30.1448090BO||wsdlUrl: requestContent: <soapenv:Envelope xmlns:soapenv="" xmlns:ser="">
<soapenv:Header>      <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="" xmlns:wsu="">
         <wsse:UsernameToken wsu:Id="UsernameToken-32ce50e8-4a5d-4040-af71-c3428d92daa7">
            <wsse:Password Type="">order</wsse:Password>
   <soapenv:Body><ser:insertLocationStaffSale xmlns:ns2=""><locationStaffSaleHistory><actionDetail></actionDetail><insertTime>2020-09-21T10:06:51.590+07:00</insertTime><source>Mbccs</source><unit>VTT</unit><userName>HANTT</userName><x>21.0164359</x><y>105.78433</y></locationStaffSaleHistory></ser:insertLocationStaffSale></soapenv:Body>
</soapenv:Envelope> output exception: Connection refused|1600657611594|3|1|Loi sendRequest exception 4

And this is my script in kibana:

if (doc['message.keyword'].length == 0) { 
    return "unavailable";
} else {
def m = /.*?http(.*?)wsdl.*?\n/.matcher(doc['message.keyword'].value);
if ( m.matches() ) {
} else {
   return "no match";

I also try other regex like


but it still not work. Can you give me some idea? Thanks.

@Marius_Dragomir can we get some help here?


It seem to be that regex can not catch in string that have many line or something like that. It just work when I cut and get substring in first line. But this solution just is temporary.

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