# Error parsing json and truncated error in JSON logs

**URL:** https://discuss.elastic.co/t/error-parsing-json-and-truncated-error-in-json-logs/370079
**Category:** Logstash
**Created:** [November 5, 2024, 3:26pm UTC](https://discuss.elastic.co/t/error-parsing-json-and-truncated-error-in-json-logs/370079 "2024-11-05T15:26:21Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Seemant\_Bind](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seemant_bind/32/107045_2.png) [@Seemant\_Bind](https://discuss.elastic.co/u/Seemant_Bind)
#### Post date: [November 5, 2024, 3:26pm UTC](https://discuss.elastic.co/t/error-parsing-json-and-truncated-error-in-json-logs/370079/1 "2024-11-05T15:26:21Z")

</div>

Hi,

I am pushing logs through Filebeat and using logstash into Elastic. I have JSON logs and for some of the logs I am getting the error `Error parsing json` , `[truncated 4301 bytes]; line: 1, column: 16]` but some of the them are getting parsed. I have checked the JSON log and can confirm that JSON is correct. Although I have tried in my local machine and it is working perfectly with the same confile and version.

Kindly advice.

Regards

---

<div class="post-metadata">

### Author: ![jessgarson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jessgarson/32/129841_2.png) [@jessgarson](https://discuss.elastic.co/u/jessgarson)
#### Post date: [November 5, 2024, 7:13pm UTC](https://discuss.elastic.co/t/error-parsing-json-and-truncated-error-in-json-logs/370079/2 "2024-11-05T19:13:43Z")

</div>

Thanks for reaching out, @Seemant_Bind. I have a few follow up questions:

- What version are you using?
- Do you have sample of the JSON you are using?

---

<div class="post-metadata">

### Author: ![Seemant\_Bind](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seemant_bind/32/107045_2.png) [@Seemant\_Bind](https://discuss.elastic.co/u/Seemant_Bind)
#### Post date: [November 6, 2024, 6:19am UTC](https://discuss.elastic.co/t/error-parsing-json-and-truncated-error-in-json-logs/370079/3 "2024-11-06T06:19:58Z")

</div>

Hi,

I am using version 7.11.1

Please see the sample JSON below

```auto
{"ModifiedDate":"2024-11-04T00:30:44","PaymentRequestId":000001,"PaymentRequestDate":"2024-11-04T00:11:49","ABCId":"0xxxxxf8-2000-4xxx-9003-4xxxxxxxxxx7","CollectionRequestId":000001,"CurrencyCodeAlpha":"USD","CustomerId":11100000,"BankId":"XXX ","ProgramId":00,"PaymentStatus":"Completed","TransferAmount":1,"MobilePhone":"xxxxxxxxxxx","CallbackDate":"2024-11-04T00:30:44","CallbackStatus":"xxx","CallbackBody":{"thirdPartyTransId":"0xxxxxf8-2000-4xxx-9003-4xxxxxxxxxx7","ABCTransId":"000000000000000000","eTransId":"000000000000","fxRate":1.0,"status":{"code":"xxx","message":"Success"},"sendAmount":{"amount":1.0,"currencyCode":"USD"},"receiveAmount":{"amount":1.0,"currencyCode":"USD"}},"ResponseDate":"2024-11-04T00:11:50","ResponseHttpStatus":200,"RequestBody":{"CorporateCode":"XXX","Password":" ************************","UniqueKey":"**********","ABCSign":null,"BatchId":"0xxxxxf8-200-4xxxx-9xxx-4xxxxxxxxxxx","RequestBody":[{"InstructionType":{"DestAcctType":"xxxxxxxxxxxx","AmountType":"ReceiveAmount","$type":"InstructionType"},"Amount":{"Amount":1.0,"CurrencyCode":"USD","$type":"InstructionAmount"},"SendFee":null,"Sender":{"Msisdn":" *********","FromCountry":"US","Name":"XXX","Surname":"XXX ","Address":"*********","City":" ********","State":"AA","PostalCode":"","Email":null,"DateOfBirth":"*********","Document":null,"$type":"Sender"},"Recipient":{"Msisdn":" *********","ToCountry":"US","Name":"*********","Surname":" *********","Address":"*********","City":" *******","State":"AA","PostalCode":"","Email":null,"DateOfBirth":"*********","Document":null,"DestinationAccount":null,"$type":"Recipient"},"ThirdPartyTransId":"0xxxxxf8-2000-4xxx-9003-4xxxxxxxxxx7","Reference":"xxxPaymentRequestId:000001,ABCAccountId:11100000","$type":"RequestBody"}],"$type":"xxxxxxxxxxxxxxxxxxxxx"},"CorrelationId":"051xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx55","TransactionId":000000000000000000,"ReverseTransactionId":0,"ResponseBody":{"totalTxSent":1,"noTxAccepted":1,"noTxRejected":0,"details":{"transResponse":[{"thirdPartyId":"0a0xxxxxf8-xxxx-4cv8-9003-4xxxxxxxxxx7","status":{"code":"100","message":"Accepted","messageDetail":null}}]},"timestamp":"2024-11-04 05:11:50"},"Otp":"Your verification code is xxxxxx. It expires in 5 minutes.","PhoneCountryCode":"xxx","MobileNetworkPrefix":"xx","MobileNetworkOperator":"xxx","Country":"xxxxx","CreateDate":"2024-11-04T00:11:49"}

```

---

<div class="post-metadata">

### Author: ![jessgarson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jessgarson/32/129841_2.png) [@jessgarson](https://discuss.elastic.co/u/jessgarson)
#### Post date: [November 7, 2024, 6:48pm UTC](https://discuss.elastic.co/t/error-parsing-json-and-truncated-error-in-json-logs/370079/4 "2024-11-07T18:48:57Z")

</div>

Thanks @Seemant_Bind, I have another follow up question, how are you configuring Filebeat?

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [November 7, 2024, 7:49pm UTC](https://discuss.elastic.co/t/error-parsing-json-and-truncated-error-in-json-logs/370079/5 "2024-11-07T19:49:48Z")

</div>

> [@Seemant\_Bind](#):
>
> `{"ModifiedDate":"2024-11-04T00:30:44","PaymentRequestId":000001,`

I realize you have redacted a lot of data in that, but if you really do have leading zeroes on numbers then the json filter will fail to parse it, since JSON does not allow them.
