The following guide will walk you through installing the package
com.paloaltonetworks.cortex.data_lake, a powerful class collection capable of supporting your next Cortex™ app, integration or automation project.
Installing from Maven Central repository
Installing from binaries
Pre-compiled binaries are available in the
/target folder of the GitHub repo. Check sha512 signature before trusting pre-build binaries.
Cortex Data Lake API Authorization
The classes in the package
com.paloaltonetworks.cortex.data_lake require an object that implements the
Function<Boolean, Map.Entry<String, String>> functional interface.
Entry returned is expected to behave as:
getKey(): Expected to return the Cortex Data Lake API end point (region)
getValue(): Expected to return a valid OAuth2 authorization access_token value.
The functional method (
apply(Boolean force)) can return
null instead of an
Entry object only if
force is either
false. In such a case a
null response can be interpreted by the caller as a signal that the latest
Entry returned is still valid.
A collection of objects implementing the interface is available in the package
com.paloaltonetworks.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
apply(Boolean force) method with the
true value and expect it to return a valid API Endpoint and OAuth2 access token.
The examples below assume the existence of a constant named
credcontaining an object implementing the
Function<Boolean, Map.Entry<String, String>>functional interface.
Querying Logging Service
- Begin by importing the
- Next, let's construct an object instance:
- 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.
Previous example code in just one block (the cred variable is supposed to exist)