This PowerShell script generates simulated syslog events and sends them to a specified syslog server. It's designed to help test and validate syslog server configurations, SIEM (Security Information and Event Management) systems, or any other log analysis tools that consume syslog data.
- Generates a variety of syslog messages simulating different system events
- Configurable syslog server address and port
- Randomized message selection for realistic log generation
- Configurable delay between messages to simulate various traffic patterns
- PowerShell 5.1 or later
- Network access to the target syslog server
- Clone this repository or download the
eventsgen.ps1script to your local machine. - Ensure that PowerShell execution policy allows running scripts. You may need to run the following command as an administrator:
Set-ExecutionPolicy RemoteSigned
Before running the script, you need to configure the syslog server details:
- Open the
eventsgen.ps1file in a text editor. - Locate the
Send-SyslogMessagefunction. - Update the
$SYSLOG_SERVERand$SYSLOG_PORTvariables with your syslog server's IP address and port:$SYSLOG_SERVER = '192.168.0.117' # Replace with your syslog server IP $SYSLOG_PORT = 514 # Replace with your syslog server port if different
To run the script, open a PowerShell window and navigate to the directory containing the script. Then execute:
.\eventsgen.ps1The script will start generating and sending syslog messages to the configured server. You will see debug output for each message sent.
To stop the script, press Ctrl+C.
The script comes with a predefined set of log messages. To customize these:
- Open the
eventsgen.ps1file in a text editor. - Locate the
$special_logsarray in theGenerate-TestLogsfunction. - Modify, add, or remove entries as needed. Each entry is a hashtable with
ProgramandMessagekeys.
Example of adding a new log message:
@{Program="custom_app"; Message="Application started successfully"},If you encounter issues:
- Ensure your firewall allows outbound connections to the syslog server.
- Verify that the syslog server is running and configured to accept messages.
- Check the script's debug output for any error messages.
Contributions to improve the script are welcome. Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
This script is for testing and educational purposes only. Ensure you have permission to send data to the target syslog server before using this script.