The following guide will walk you through installing
@paloaltonetworks/pan-cortex-data-lake, a powerful package capable of supporting your next Cortex™ app, integration or automation project.
Installing with npm
You can add the
@paloaltonetworks/pan-cortex-data-lake dependency in your project directly from the NPMJS repository
Installing from source
In case you need to play with a pre-release version of the package then you can add dependencies from the GitHub public repo.
Source code is written in TypeScript and the build process produces type definition files which means you can leverage strongly type and code auto-complete features.
Cortex Data Lake API Authorization
The classes in the package
@paloaltonetworks/pan-cortex-data-lake require an object that implements the Credentials Interface.
A collection of objects implementing the interface is available in the package
@paloaltonetworks/pan-cortex-hub See Hub Quickstart
Getting started with a Developer Token
Maybe the easiest way to get started is by leveraging a Developer Token provided by the API Explorer's Token Redemption Service. Just define the needed environmental variables ...
...and then instantiate an object of the
If you want to verify the object is working as expected then just call its
getToken() method with the
true value and expect it to return a valid OAuth2 access token.
The examples below assume the existence of a constant named
credcontaining an object implementing the Credentials Interface.
Querying Logging Service
- Begin by importing the package
- Next, let's construct a
- Now, let's define the SQL sentence we want to execute:
- Pass the SQL sentence to the
QueryServiceClientobject to receive an iterator object:
- Now, let's print the execution results (notice the ES2018
for awaitsyntax executed inside an async lambda expression)
Previous example code in just one block (the cred variable is supposed to exist)