Overview To obtain the download history of a specific package from Artifactory, the JFrog Platform provides standardized logs for all its products and services. These logs have a standard format and naming convention, and the corresponding active log files for each JFrog service are located in the "$JFROG_HOME/<product>/var/log" directory.
To fetch the download history of a particular package that has been downloaded by users from Artifactory, you need to parse through the artifactory-request.log file, which contains all the information related to the requests reaching Artifactory. To obtain the package's download history, you can perform a grep of the package name along with grep on the GET request in the request.log file located under "$JFROG_HOME/artifactory/var/log".
To execute the command and fetch the download history of a package, you need to use the following command:
cat artifactory-request.log | <package-name> | grep GET
For example:
cat artifactory-request.log | grep multi1-3.7-20230321.165450-1.jar | grep GET
The above command will produce output similar to the following:
Example 1 2023-03-21T16:56:11.311Z|e364009d755dff|11.115.037.150|admin|GET|/test01-libs-snapshot-local/multi1/multi1/3.7-SNAPSHOT/multi1-3.7-20230321.165450-1.jar|200|-1|1035|7|Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Example 2 2023-03-21T17:00:01.816Z|561399bd07df0a7|11.115.047.151|test01|GET|/test01-libs-snapshot-local/multi1/multi1/3.7-SNAPSHOT/multi1-3.7-20230321.165450-1.jar|200|-1|1035|13|Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
As shown in the output above, the package "multi1-3.7-20230321.165450-1.jar" has been downloaded by two users, namely admin, and test01. Therefore, the download details for a specific package can be obtained.
If you want to obtain the package download details only for a specific user, you can append "| grep <username>" to the above command.
Note that the above output will only be for the active log files present in the logs directory. Therefore, to obtain complete details, you need to extract all the archived logs.
For more information on logging, please refer to the Artifactory Logging and Artifactory Log Files documentation.