SDK to download the Netskope Events
Project description
Netskope SDK
Neskope SDK is Python library for dealing with API's to download the Netskope events.
Installation
Use the package manager pip to install NetskopeSDK.
pip install netskopesdk
Usage
from netskope.api.iterator.netskope_iterator import NetskopeIterator
from netskope.api.iterator.const import Const
from requests.exceptions import RequestException
import time
# Construct the params dict to pass the authentication details
params = {
Const.NSKP_TOKEN : "<REST-API-TOKEN",
Const.NSKP_TENANT_HOSTNAME : "<HOSTNAME>",
Const.NSKP_EVENT_TYPE : "<EVENT-TYPE>",
Const.NSKP_ITERATOR_NAME : "<ITERATOR-NAME>"
}
# Create an Iterator
iterator = NetskopeIterator(params)
# To consume the data form the beginning , start the iterator with head()
response = iterator.head()
# To consume the data form the latest timestamp , start the iterator with tail()
response = iterator.tail()
# To consume the data form a specific timestamp , start the iterator with timestmap()
response = iterator.download(<epoc-timestamp>)
# To stream the data use the next() iterator
# Consume the message indefinitely in a loop and ingest the data to SIEM
while True:
response = (iterator.next())
try:
if response:
data = response.json()
if "result" in data and len(data["result"]) != 0:
# Ingest the response data to SIEM .
# if( ingestion-fail ):
# User resend
#response = iterator.resend()
else:
print("No response received from the iterator")
# Sleep for desired time and recommended 5 sec
# time.sleep(5)
except Exception as e:
raise RequestException(e)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
netskopesdk-0.0.8.tar.gz
(4.9 kB
view details)
Built Distribution
File details
Details for the file netskopesdk-0.0.8.tar.gz
.
File metadata
- Download URL: netskopesdk-0.0.8.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd8f5e73b7d21dba9f101bc6f9fa22196eed61038c0ad0aec5649ea9540077d0 |
|
MD5 | 3bb5e8c63fbdfb678304ac1bafca5ed3 |
|
BLAKE2b-256 | 5ceb52726d56671d81ec1f683c2a0610799f4b732532fc8e31836a4706d20415 |
Provenance
File details
Details for the file netskopesdk-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: netskopesdk-0.0.8-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93def451df138393f65752d8e477ba02739d23df819aa59c614c10785957259e |
|
MD5 | 24e39f3f9c0ba5e76bb384deca816215 |
|
BLAKE2b-256 | 59c26a52c7d54ad9140c3e9407bd4032fce10247b490ee195f6ad32d38a9bd92 |