...
The information on this page refers to License Statistics v6.14 21 and newer, which introduced stable API v3the ability to use DNS and rDNS lookup to find missing host details during import. If you are using a version previous to v6.1421, see see documentation for previous versions. |
...
Code Block | ||
---|---|---|
| ||
#!/bin/sh curl -X POST "{HOSTNAME}/api/v3/admin/license-server/{LICENSE_SERVER_ID}/import?gather={GATHERING}&mergePolicy={MERGE_POLICY}&from={FROM}&to={TO}&resolveDomainNamesToIP={DNS}&findDomainNamesByIP={RDNS}" \ -H "accept: application/json" \ -H "X-Auth-token: {API_TOKEN}" \ -H "Content-Type: multipart/form-data" \ -F "file=@{FILE}" |
where:
Query Parameter | Example Variable | Type | Description | Default |
---|---|---|---|---|
HOSTNAME | string | License Statistics instance | ||
LICENSE_SERVER_ID | integer | License Server ID | ||
gather | GATHERING | string | Denials and/or Usage | "Denials,Usage" |
mergePolicy | MERGE_POLICY | string | Reject/Replace/Merge/Leave Tail | "Reject" |
from | FROM | string | Start of time range import; format: yyyy-MM-dd HH:mm[:ss] | Beginning of the log file |
to | TO | string | End of time range import; format: yyyy-MM-dd HH:mm[:ss] | End of the log file |
resolveDomainNamesToIP | DNS | boolean | Find unknown host IP address using DNS lookup | false |
findDomainNamesByIP | RDNS | boolean | Find unknown hostname using Reverse DNS lookup | false |
API_TOKEN | string | API token | ||
FILE | string | Name of the file to import |
...
Code Block | ||
---|---|---|
| ||
#!/bin/sh
curl -X POST "https://licstat-demo.x-formation.com/api/v3/admin/license-server/40/import?gather=Denials&from=2021-01-10%2015%3A10%3A00&to=2021-02-10%2019%3A13%3A23" \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log" |
Example 6
The following example shows using the import API command for importing data using DNS and rDNS lookup for missing IP addresses and hostnames, respectively.
Code Block | ||
---|---|---|
| ||
#!/bin/sh
curl -X POST "https://licstat-demo.x-formation.com/api/v3/admin/license-server/40/import?resolveDomainNamesToIP=true&findDomainNamesByIP=true" \
-H "accept: application/json" \
-H "X-Auth-token: e765ee9c3ded6ca6e5e7f4d0d01189d0" \
-H "Content-Type: multipart/form-data" \
-F "file=@license-server.log" |
...