Skip to main content

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


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.9.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

netskopesdk-0.0.9-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file netskopesdk-0.0.9.tar.gz.

File metadata

  • Download URL: netskopesdk-0.0.9.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

Hashes for netskopesdk-0.0.9.tar.gz
Algorithm Hash digest
SHA256 00f234cf76936c59926dbdb71a5a008deb05f32cab4595194eeaa907c4048717
MD5 9bb57f7adf3abf0cc0c866cc64b0c085
BLAKE2b-256 7f1792bfd8dd0a41f20f7a6859238cc98b7c9bb993edd31d80e12f73633bc684

See more details on using hashes here.

Provenance

File details

Details for the file netskopesdk-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: netskopesdk-0.0.9-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

Hashes for netskopesdk-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 a8e6c6851732517fd52c95df32d846d05ad0cd15710f96c338d5b5b1ece9488b
MD5 81738b056bd99098134d2878dd506fda
BLAKE2b-256 a05262393e7f6079022dafdbf520bc3c6b73030d840241bdc980d6bc43d6ccd9

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page