Path: blob/master/tutorials-and-examples/feature-tutorials/Sumologic-DataConnector.ipynb
3253 views
Sumologic - Data Connector
Description
The data provider module of msticpy provides functions to allow for the defining of data sources, connectors to them and queries for them as well as the ability to return query result from the defined data sources.
For more information on Data Propviders, check documentation
In this notebooks we will demonstrate Sumologic data connector feature of msticpy. This feature is built on-top of the [Sumologic SDK for Python] (https://github.com/SumoLogic/sumologic-python-sdk) with some customizations and enhancements.
Installation
Authentication
Authentication for the Sumologic data provider is handled by specifying credentials (accessid and accesskey) directly in the connect call or specifying the credentials in msticpy config file.
For more information on how to create credentials, follow Sumologic Docs Access Keys and Users and Roles. The user should have permission to at least run its own searches or more depending upon the actions to be performed by user.
Once you created user account with the appropriate roles, you will require the following details to specify while connecting
url = "https://api.us2.sumologic.com/api" (Sumologic url endpoint depending on which region is used)
accessid = "xxx" (as created in Sumologic user preferences)
accesskey = "xxx" (same)
Once you have details, you can specify it in msticpyconfig.yaml as shown in below example
Instantiating a query provider
You can instantiate a data provider for Sumologic by specifying the credentials in connect or in msticpy config file.
If the details are correct and authentication is successful, it will show connected.
URL endpoints are referenced on Sumo Logic Endpoints and Firewall Security
Running a Ad-hoc Sumologic query
You can define your own sumologic query and run it via sumologic provider via QUERY_PROVIDER.exec_query(<queryname>)
For more information, check documentation Running and Ad-hoc Query
References
Sumologic SDK for Python: https://github.com/SumoLogic/sumologic-python-sdk
Sumologic Community : https://support.sumologic.com/hc/en-us/community/topics
Sumologic Documentation: https://help.sumologic.com/