Introduction
This article will cover the steps to get that amount, by using Xray’s logs.
While we cover the scenario for the daily amount, the timeframe may be changed to fit any other time.
Depending on your configuration, Xray scans different amounts of artifacts daily, either automatically or on demand.
To get the number of scanned artifacts on a specific date, we can search for logs about scans that were completed on that date.
Logs about completed scans may be found in the file xray-server-service.log.
Important: Please note that procedure is relevant for logs that have not been rotated. Logs that have been rotated and are in an archive file are not checked by this procedure.
Resolution
- On the Xray instance, navigate to $XRAY_HOME/var/log/xray-server-service.log.
$XRAY_HOME might differ according to the instance’s OS. - The relevant value for the search is “source: sca, from status: SCANNING to status: DONE”.
- The date should be in the format of YYYY-MM-DD.
- To get the amount of scans that were completed on a specific date, we can use the below command:
grep "source: sca, from status: SCANNING to status: DONE" $XRAY_HOME/var/log/xray-server-service.log | grep “<SOME SPECIFIC DATE>” | wc -l