PowerShell: automatically delete files older than X days

In this tutorial, we will see how to delete files older than X day using PowerShell. This type of script is often used in businesses on servers to rotate logs. If we take the example of IIS, the logs are never deleted, which means that after 3 years, we end up with more than 1,000 …

Read more



IIS – Add the X-Forwarded-For field in the logs

In this tutorial, I will explain how to add the X-Forwarded-For field in the IIS logs, in order to retrieve the real IP address of a visitor when a reverse proxy is upstream of the IIS server. On the IIS Web server, open the Internet Services Management console. Select server 1 and click Logging 2. …

Read more



Ubuntu: configure systemd log size

In this tutorial, we will see how to configure the size of systemd logs on an Ubuntu distribution. By default, the logs located in the /var/log/journal folder can take several gigabytes of disk space. As can be seen from the screenshot below, the logs take up 4 Giga of disk space. The configuration of the …

Read more



Nginx: get the visitor’s real IP with CloudFlare

In this tutorial, I will explain how to get the real IP address of visitors using CloudFlare services and an Nginx web server. What I will explain to you in this tutorial is valid when Nginx is used as a front-end web server or as a reverse proxy. By default, when using CloudFlare in Proxy …

Read more



Crowdsec: send logs to Elasticsearch (ELK)

In this tutorial, I will explain how to send decision logs to Elasticsearch (ELK) so that you can create a dashboard to use the logs. What you need to achieve what described in the tutorial: Crowdsec version 1.2.x or higher an Elasticsearch server or an ELK stack Since version 1.2 of Crowdsec, a notification system …

Read more



Linux: display logs in real time

In this “how” tutorial, I will explain how to display logs in real time saved in a file in SSH This type of manipulation is useful when you want to see what is happening in real time. To illustrate this tutorial, I used the access logs of an NGINX server. Use the tail -f command …

Read more



Veeam: change the location of the logs

Introduction Veeam backup software writes a lot of logs and they are stored by default on drive C at the following location C:\ProgramData\Veeam\Backup. As you can see in the screenshot below, this represents a certain volume, over 4GB, and if the C: \ drive starts to run out of space, it might be worth moving …

Read more