This repository has been archived by the owner on Jun 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Bulk Submissions
Wes edited this page Aug 18, 2017
·
1 revision
If you are using the API to submit over 50 records you will want to ensure you are not making 50 individual HTTP POSTs to the CIF server.
Make sure you are submitting a single list/array of 50 records. Note that the server will not return the submission IDs until all the post processing is done, if you are submitting 10000 records it could take a few minutes to get a return from the server.
Python SDK Example:
from cifsdk.client import Client
import json
cli = Client(token='<token>',
remote='https://localhost',
no_verify_ssl=1)
# sample dict
d = {"indicator":"1.1.1.1","tlp":"amber","confidence":"8","tags":"malware","provider":"me.com","group":"everyone"}
# build list of dicts
build = 0
data = []
while build < 10000:
data.append(d)
build += 1
# json'ify the list
json_data = json.dumps(data)
ret = cli.submit(json_data)
print(ret)
Use the client argument nowait
to tell the server to batch submissions on the server side.
Python SDK Example:
cli = Client(token='<token>',
remote='https://localhost',
no_verify_ssl=1
nowait=True)
Reference:
Bottleneck sending events through HTTP API