SDK and CLI reference

Every command of the xpologClient.jar SDK: connection parameters, settings and security users, accounts (SSH, Remote XPLG, S3), scan and Log Sync tasks, folders and logs including Windows Event Logs, AppTag time zones, license, restart and patches; plus the command-line update package.

What you will do: configure one or many deployments from scripts instead of the console.

The SDK is a Java client, xpologClient.jar, that runs on any machine with a Java runtime and HTTP/S access to the server; for HTTPS the .keystore file shipped with the SDK must sit next to the jar. The XPLG downloads (the jar, the keystore zip and example scripts) are linked from the wiki's SDK page.

Connection

java -cp xpologClient.jar com.xpolog.sdk.client.XpoLogSDKClient \
  -xpologURL https://<host>:30443/logeye -user <user> -password <password> -api <command> <parameters>

xpologURL is mandatory; user and password are mandatory once security is active. Scripts define the two parts once — JAVA_RUN for the Java call and XPLG_CONN for the connection — and write %JAVA_RUN% %XPLG_CONN% on Windows or $JAVA_RUN $XPLG_CONN on Linux before each command; the examples below use the Linux form. Wrap every value that contains a space in quotes.

Settings and security

CommandParametersExample
settingshttpPort, sslPort, shutdownPort, ajpPort; agentMode true/false; activateSecurity true/false; activateSystemTimeZone, activateDynamicTimeZone, activateAppTagsTimeZone true/false (the user time-zone mode)-api settings -httpPort 30304 -sslPort 30444 -ajpPort 8010 -shutdownPort 8096 -agentMode true -activateSecurity true
settings (AppTag time zone)appTags (comma-separated, as defined), timeZone (a Java time zone, or Default); applies only when the time-zone mode is AppTags-api settings -timeZone "America/New_York" -appTags "APPTAG1, APPTAG2"
securityUsersname, userPassword, displayName (mandatory for a new user); override; userPolicy; selectedGroupsList (;-separated)-api securityUsers -name ops -userPassword <pw> -displayName "Ops User" -userPolicy ViewOnly -selectedGroupsList "ops;All" -override true

Accounts

CommandParametersExample
addSSHAccountname; hostName; conType SFTP (default) or SCP; port (22); username, userPassword or privateKeyPath; description; override; enabled-api addSSHAccount -name "web-01" -hostName 10.0.0.11 -conType SFTP -port 22 -username xplg -userPassword <pw> -override true -enabled true
addRemoteXpoLogAccountname; hostName; conType HTTP (default) or HTTPS; port; context (logeye); isCollected true = Agent Mode, false = proxy mode (default true); username, userPassword; description; override; enabled-api addRemoteXpoLogAccount -name "agent-win-01" -hostName 10.0.0.21 -conType HTTPS -port 30443 -context logeye -isCollected true -username <user> -userPassword <pw> -override true -enabled true
addExternalAccountexternalMediaType s3 (lower case); name; ema_custom_accessKey, ema_custom_secretKey; description; override; enabled-api addExternalAccount -externalMediaType "s3" -name "archive-bucket" -ema_custom_accessKey "<key>" -ema_custom_secretKey "<secret>" -override true
enableAccountname; enabled true/false-api enableAccount -name "web-01" -enabled false
removeAccountname-api removeAccount -name "web-01"

Tasks

CommandParametersExample
executeTaskname (case-sensitive)-api executeTask -name "Nightly scan"
executeScanTaskRun an Add Logs Directory scan once: name, id (avoids re-creating logs on repeated runs), parentFolderPath (ROOT->…), accountName (mandatory for SSH), scanPath, plus any ScanConfiguration parameter as -<param> <value> (scanMethod, timeZone, directoriesToInclude, filesToExclude, …)-api executeScanTask -name "SCANNER_SDK" -id "SCAN12345" -parentFolderPath "ROOT->Servers" -accountName web-01 -scanPath "/var/log/" -scanMethod 0 -timeZone GMT -filesToExclude "*.zip,*.gzip,*.tar*"
addScanTaskThe same, saved as a scheduled task: add cron (Unix cron expression), override, assignedCollectionPolicy-api addScanTask -name "SCANNER_SDK" -id "SCAN12345" -parentFolderPath "ROOT->Servers" -accountName web-01 -scanPath "/var/log/" -cron "0 * * * * ? *" -assignedCollectionPolicy "Default"
addSyncLogTaskA Flux Log Sync task: name; configFilePath (the task XML); createConfiguration true/false; parentFolderPath; cron; assignedNode (the cluster node that runs it); override — see Sync task reference-api addSyncLogTask -name "Sync site A" -configFilePath /opt/xplg/sync-a.xml -override true -cron "0/10 * * * * ? *"

Folders and logs

CommandParametersExample
addLoglogName; logPath (ROOT->…, without the log name); filesPath (absolute path with optional name pattern, or for a Remote XPLG log its path in the remote tree); patterns (several separated by XPLG_SDK_SEP) or template; accountName (mandatory for SSH and Windows network sources); collectionPolicy (exact name); appTags (comma-separated) and overrideAppTags; timezone, charset; dataFilterQuery (empty clears it); override; to rename or move an existing log, newLogName or newLogPath with override true-api addLog -logName "messages" -logPath "ROOT->Servers->web-01" -filesPath "/var/log/messages{string}" -template "Linux messages" -accountName web-01 -appTags "Linux OS"
addLog (Windows Event Logs)Needs an XPLG instance on Windows: winEventFileType (Application, Security, System, …); host (default localhost); unc true to read the .evtx file directly (faster, needs permissions) or filesPath to a custom .evtx location (never both); accountName for a Windows authentication account when the service account is not enough; logName, logPath, collectionPolicy, appTags, timezone, override-api addLog -logName "Application" -logPath "ROOT->Windows Events->dc-01" -winEventFileType "Application" -host dc-01 -accountName win-collector -override true -appTags "Windows Event Logs"
addFolderfolderPath-api addFolder -folderPath "ROOT->Servers->web-02"
removeMemberfolderPath (removes the folder and everything in it) or logPath-api removeMember -logPath "ROOT->Servers->web-01->messages"

License, restart and patches

CommandParametersExample
licensefiles — the .lic file (relative or absolute path)-api license -files license.lic
restart—-api restart
addPatchtype api; files — the patch zip; writeErrors false to ignore the connection error thrown while the server restarts-api addPatch -type api -files /tmp/patch.zip -writeErrors false

Typical scripts

  • Onboard a server in a dynamic environment: addSSHAccount, then addScanTask (or executeScanTask) under its folder — the logs appear and are collected without the console.
  • Decommission but keep the data: enableAccount -enabled false so XPLG stops connecting while retention keeps what was collected.
  • Decommission and drop the data: removeAccount and removeMember -folderPath on the server's folder.
  • Mass rollout: silent installations, then settings (ports, Agent Mode, security) and securityUsers on each instance — see Agent Mode.

The command-line update package

For V7 patches the wiki provides CLI_Update.zip with applyPatch.sh (Linux) and applyPatch.bat (Windows): put the patch zip and the package in one directory, extract the package, edit the script's placeholders for your environment (the README explains the parameters) and run it; then confirm the build on PortX > System > About and validate as on Upgrades. The host that runs it needs Java and HTTP/S access to every instance; a valid V7 license is required, and behind a load balancer publish from one node directly.

Next: Endpoint index

Source: XPLG wiki, pages 1597014018, 1597014014, 1602191443, 1594131988, 2054684673 (https://xpolog.atlassian.net/wiki/spaces/XPOL/pages/1597014018).

XPLGXPLG
Docs

Search documentation

Search through help articles and documentation

    • Introduction
    • Create your account and workspace
    • Your first deployment in 10 minutes
    • Configure after installation
    • Register a deployment
    • Get an evaluation license
    • Next steps
    • Glossary
    • Overview and authentication
    • Product API and SDK
    • XpoLog search API
    • PortX ingest HTTP API
    • Configuration API
    • SDK and CLI reference
    • Endpoint index
Back to XPLG Dock