In Garbage collection log analysis API we have introduced a new feature called Remote Location. Using this feature now you can pass the http(s) URL location of your GC log in the request.

Say suppose, you have stored your GC log files in a remote location like AWS S3 bucket. In those cases, if you want to analyze your GC logs then you will have to download files to your local machine and then invoke the API with GC log file. To make it simple and automation easier we have introduced ‘location’ parameter in our API. You can pass http(s) URL location to the “location” parameter and invoke the API. When you do it the API will download file from the remote location, analyze the data and return back the response.

Here is a CURL command to invoke GC log analysis API,

You can also invoke the API using other web service client tools such as: Postman, Soup UI, …

Here is an example of Postman tool,

Fig. Posting GC log through Postman tool

Our API supports the following 13 file compress formats: zip, gz, xz, z, bz2, deflate, lz4, lzma, sz, zstd, tgz, tar, tar.gz. Compressing files is the process of making them smaller in terms of the number of bytes of data that they contain. We recommend you to compress and send GC log files for fast and efficient processing. If you are passing a compressed GC log file to the API then you need to pass “Content-Encoding” parameter in the request or add in request header.

Say suppose you are compressing GC log file into ZIP format, then you can invoke the API with “Content-Encoding” request parameter:

Or you can pass “Content-Encoding” as HTTP header:

Note – Use the option “-data-binary” in the curl command instead of “-data” option. In “-data” option a new line break will be not preserved in the request. A new line break should be preserved for the legitimate parsing.

Here is an example of a Postman tool where passing “Content-Encoding” parameter in a API request.

Fig: How to pass “Content-Encoding” parameter in a API request?

Authenticating with remote servers

Some remote servers expect you to pass proper authentication credentials to download the resource. GCeasy provides you a simple mechanism to pass such authentication credentials.

Say you have stored your GC log file in a JFrog artifactory server. Inorder to download any resources from the JFrog artifactory, it expects you to pass the X-JFrog-Art-Api header element with your assigned API Key. Say your API key is: ‘abc123’. 

In order to pass this API key to JFrog artifactory server, you can invoke the GCeasy API with location-X-JFrog-Art-Api=abc123 http parameter in the URL.

curl -X POST "{YOU_API_KEY}&location={GC-LOG-HTTP-URL}&location-X-JFrog-Art-Api=abc123" --header "Content-Type:text"

Basically you need to prefix the authentication parameter name with the “location-“ prefix string and invoke the GCeasy API.

You can invoke also pass this element in HTTP header instead of HTTP URL i.e.

curl -X POST "{YOU_API_KEY}&location={GC-LOG-HTTP-URL}" --header "Content-Type:text" --header "location-X-JFrog-Art-Api:abc123"

Note: Remote Location feature is only available in the GCeasy Enterprise edition