All Apps and Add-ons

REST API Modular Input: Is there a limit on JSON size before parsing?

DanielFordWA
Contributor

Hi,

Is there any limit on the size of the JSON the REST API Modular Input add-on can handle before the responsehandlers.py goes to work?

I have written a custom response handler to parse a large JSON file into separate events before indexing in Splunk.

In UAT and NFR environments everything works fine. The JSON is around 16.5k lines and 400K characters.

In PROD the data fails to index. The JSON is around 100k lines and 3M characters.

The sourcetype is set to the below.

[RESTMAR]
TRUNCATE = 0
TIME_PREFIX = lastModifiedDate

I can hit the endpoint with POSTMAN for both UAT /NFR and PROD, with the separate consumer secrets and keys, and get a successful response for each Environment.

I have edited the rest.py line 42 to put the logger on debug

#set up logging
logging.root
logging.root.setLevel(logging.DEBUG)

I will continue to investigate but has anyone else had this issue?

Thanks,

Dan

0 Karma
1 Solution

Damien_Dallimor
Ultra Champion

There is no imposed limits in the code.
Any error messages ?

Search : index=_internal ExecProcessor error rest.py

View solution in original post

0 Karma

Damien_Dallimor
Ultra Champion

There is no imposed limits in the code.
Any error messages ?

Search : index=_internal ExecProcessor error rest.py

0 Karma

DanielFordWA
Contributor

Hi Damien,

I think the issue was caused by moving the responsehandlers.py file from a windows box to a Linux box, or editing a previously created input rather than creating a new one.

The solution.

  • Test on NFR Linux box
  • Copy files from NFR box
  • Reinstall REST Modular input app in PROD
  • Add python files copied from NFR Linux box
  • Restart Splunk
  • Create New REST Modular input (editing a previously created input did not work)
  • Test data

Thanks for the response!

Cheers,

Dan

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...