Used to send Splunk alerts (via Alert Manager Enterprise) to Discord via a webhook.
In the application Alert Manager Enterprise, you will need to configure the notificiation to web
using the URL of this server.
Splunk will send body to the server which will then be sent to Discord after some formatting to use Discord's embeds.
Make sure to install the dependencies:
pnpm install
You will also need to create a .env
file with the following variables:
# Discord webhook URL
DISCORD_WEBHOOK=
Note
Do not forget to add it to your production environment as well.
Start the development server on http://localhost:3000
pnpm run dev
Tip
You can use https://smee.io/ to test the application locally.
Run ESLint:
pnpm run lint
Fix ESLint errors:
pnpm run lint:fix
Build the application for production:
pnpm run build
Locally preview production build:
pnpm run preview
We use pm2 to manage the application in production.
# Start the application
pm2 start ecosystem.config.cjs
# Stop the application
pm2 stop ecosystem.config.cjs
# Restart the application
pm2 restart ecosystem.config.cjs
# Or reload the application using pm2 reload ...
You can also access the application logs using pm2:
pm2 logs