here is an example.
Input into Filebeat
2 2016-12-05 00:01:10.103 default-workqueue-1: Host Response
Inbound Message
----------------------------
ID: 3975975
Response-Code: 200
Encoding: UTF-8
Content-Type: text/xml; charset=utf-8
Headers: {Cache-Control=[private, max-age=0], Connection=[close], Content-Language=[en-ZA], Content-Length=[1870], Content-Type=[text/xml; charset=utf-8], Date=[Sun, 04 Dec 2016 22:01:09 GMT], Server=[Microsoft-IIS/7.5], X-AspNet-Version=[4.0.30319], X-Powered-By=[ASP.NET]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<r0:creditVendResp xmlns:b0="http://www.nrs.eskom.co.za/xmlvend/base/2.1/schema" xmlns:r0="http://www.nrs.eskom.co.za/xmlvend/revenue/2.1/schema">
<b0:clientID xsi:type="b0:EANDeviceID" ean="**************"/>
<b0:serverID xsi:type="b0:EANDeviceID" ean="**************"/>
<b0:terminalID xsi:type="b0:GenericDeviceID" id="1"/>
<b0:reqMsgID dateTime="20161205001309" uniqueNumber="59602"/>
<b0:respDateTime>2016-12-05T00:01:09.7574997+02:00</b0:respDateTime>
<b0:dispHeader>CREDIT VEND - TAX INVOICE</b0:dispHeader>
<b0:operatorMsg>060000 Warning: This meter is not configured for FBE.</b0:operatorMsg>
<b0:custMsg>Meter not registered for Free Basic Electricity. Please apply at your local office.</b0:custMsg>
<b0:clientStatus>
<b0:availCredit value="15345748.71" symbol="R"/>
</b0:clientStatus>
<b0:utility name="Eskom Online" address="Megawatt Park, Contact Centre tel 086-003-****" taxRef="4740101508"/>
<r0:creditVendReceipt receiptNo="**************">
<r0:transactions>
<r0:tx xsi:type="r0:CreditVendTx">
<r0:amt value="50" symbol="R"/>
<r0:creditTokenIssue xsi:type="b0:SaleCredTokenIssue">
<b0:desc>Normal Sale</b0:desc>
<b0:meterDetail msno="***********" sgc="100600" krn="1" ti="07">
<b0:meterType at="07" tt="02"/>
</b0:meterDetail>
<b0:token xsi:type="b0:STS1Token">
<b0:stsCipher>70476449248744181379</b0:stsCipher>
</b0:token>
<b0:units value="48" siUnit="kWh"/>
<b0:resource xsi:type="b0:Electricity"/>
</r0:creditTokenIssue>
<r0:tariff>
<b0:name>SG=100600 TI=07</b0:name>
<b0:desc>48 kWh @ 104.26 c/kWh</b0:desc>
</r0:tariff>
</r0:tx>
<r0:tenderAmt value="50" symbol="R"/>
</r0:transactions>
</r0:creditVendReceipt>
</r0:creditVendResp>
</soap:Body>
</soap:Envelope>
--------------------------------------
In Logstash the first Grok is:
^[0-9]?\s%{PESTIMESTAMP:logtimestamp}\s%{THREAD_NAME8:threadName}:\s%{GREEDYDATA:restOfTheMessage}
Then the Warning below happens on the next Grok
Payload:\s%{XML_PAYLOAD:restOfTheMessage}[-]{28}$
where
MILLISECOND [0-9]{3}
PESTIMESTAMP %{YEAR}-%{MONTHNUM}-%{MONTHDAY}\s%{HOUR}:%{MINUTE}:%{SECOND}\.%{MILLISECOND}
THREAD_NAME8 default-workqueue-[0-9]{1,4}
XML_PAYLOAD <(.*[\n|\r])*
Filebeat has some log lines that might indicated why this is happening:
2017-01-19T13:54:48+02:00 ERR Failed to publish events caused by: read tcp [::1]:65251->[::1]:5044: i/o timeout
2017-01-19T13:54:48+02:00 INFO Error publishing events (retrying): read tcp [::1]:65251->[::1]:5044: i/o timeout
2017-01-19T13:54:48+02:00 DBG close connection
2017-01-19T13:54:48+02:00 DBG send fail
But I can see why the 2nd grok fails with the error and not the 1st.
There does not seem to be an issue with the Groks because they are fine for all other log lines and don't fails with these examples when tested in http://grokconstructor.appspot.com/
Result
Timeout executing grok 'Payload:\s%{XML_PAYLOAD:restOfTheMessage}[-]{28}$' against field 'message' with value 'Value too large to output (2939 bytes)! First 255 chars are: 2 2016-12-05 00:01:10.103 default-workqueue-1: Host Response
Inbound Message
ID: 3975975
Response-Code: 200
Encoding: UTF-8
Content-Type: text/xml; charset=utf-8
Headers: {Cache-Control=[private, max-age=0], Connection=[close],'!