Splunk SPL query — Top 10 source IPs generating SSH authentication failures
Splunk SPL query — Top 10 source IPs generating SSH authentication failures
Splunk / SIEM
Command
index=main sourcetype=syslog "Failed password" | stats count by src_ip | sort -count | head 10
Syntax
index=<index> sourcetype=<type> <filter> | stats count by <field> | sort -<field>
Use case
SOC analyst creating a saved search or dashboard panel to monitor and alert on SSH brute-force attempts across the environment.
Explanation
Splunk Search Processing Language (SPL) query: • index=main → Search the main index • sourcetype=syslog → Filter to syslog events • "Failed password" → Keyword match • stats count by src_ip → Aggregate by source IP • sort -count → Sort descending • head 10 → Limit to top 10 Schedule this as an alert with threshold (e.g., count > 100) for automated detection.
Example output
src_ip count
203.0.113.1 1847
198.51.100.2 923
192.0.2.45 412
172.16.0.200 89
More examples
Primary example
index=main sourcetype=syslog "Failed password" | stats count by src_ip | sort -count | head 10
SOC analyst creating a saved search or dashboard panel to monitor and alert on SSH brute-force attempts across the environment.
Related
List all registered Wazuh agents and their current connection status
List all registered Wazuh agents and their current connection status
/var/ossec/bin/agent_control -l
Query Wazuh REST API for recent high-severity alerts (level 10+)
Query Wazuh REST API for recent high-severity alerts (level 10+)
curl -k -u admin:SecretPassword -X GET "https://wazuh-manager:55000/alerts?pretty=true&limit=10&sort=-timestamp&q=rule.level>=10"
Windows failed logon (Event 4625) brute-force detection with time bucketing
Windows failed logon (Event 4625) brute-force detection with time bucketing
index=windows EventCode=4625 | bucket _time span=5m | stats count by _time, src_ip, Account_Name | where count > 10 | eval alert="Possible Brute Force" | table _time, src_ip, Account_Name, count, alert