Setting up notifications for successful SSH logins to Slack on a Linux server is pretty easy. Before everything, please make sure to create a Slack app (if not already), add a Webhook and keep its URL handy.
To get started, login to your instance as root (or as a sudoer user) and run below commands:
# create a directory in /opt
sudo mkdir -p /opt/ssh2slack
# paste the contents from file included and save it with Ctrl+O and Ctrl+X
sudo nano /opt/ssh2slack/slack_message.json