Configuration is below :
input {
syslog {
port => 5514
type => "scylladb"
}
}
filter {
if [type] == "scylladb" {
grok{
match => {"message" => "%{IP:server_ip}:%{DATA:server_port},\s%{DATA:category},\s%{DATA:consistency},\s%{DATA:table_name},\s%{DATA:keyspace_name},\s%{GREEDYDATA:operation},\s%{DATA:source}:%{DATA:source_port},\s%{DATA:username},\s%{GREEDYDATA:error}"
}
}
if "_grokparsefailure" in [tags]
{
drop{}
}
}
}
output {
stdout { codec => rubydebug }
}
My syslog configuration:
# /etc/rsyslog.conf configuration file for rsyslog
#
# For more information install rsyslog-doc and see
# /usr/share/doc/rsyslog-doc/html/configuration/index.html
#
# Default logging rules can be found in /etc/rsyslog.d/50-default.conf
#################
#### MODULES ####
#################
module(load="imuxsock") # provides support for local system logging
#module(load="immark") # provides --MARK-- message capability
# provides UDP syslog reception
#module(load="imudp")
#input(type="imudp" port="514")
# provides TCP syslog reception
#module(load="imtcp")
#input(type="imtcp" port="514")
# provides kernel logging support and enable non-kernel klog messages
module(load="imklog" permitnonkernelfacility="on")
###########################
#### GLOBAL DIRECTIVES ####
###########################
#
# Use traditional timestamp format.
# To enable high precision timestamps, comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
# Filter duplicated messages
$RepeatedMsgReduction on
#
# Set the default permissions for all log files.
#
$FileOwner syslog
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
$PrivDropToUser syslog
$PrivDropToGroup syslog
#
# Where to place spool and state files
#
$WorkDirectory /var/spool/rsyslog
#
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf
#Send logs to client server
$PreserveFQDN on
*.* @<Ip of client where logstash is running>:5514
$ActionQueueFileName queue
$ActionQueueMaxDiskSpace 1g
$ActionQueueSaveOnShutdown on
$ActionQueueType LinkedList
$ActionResumeRetryCount -1
My time stamp in audit log is Jan 11 08:02:20
year is not present.
{
"@timestamp" => 2024-01-11T08:02:20.000Z,
"facility" => 1,
"severity_label" => "Notice",
"priority" => 13,
"timestamp" => "Jan 11 08:02:20",
"host" => "172.35.63.35",
"facility_label" => "user-level",
"logsource" => "ip-172-35-63-35.ec2.internal",
"@version" => "1",
"message" => "\"172.35.63.35:0\", \"DDL\", \"ONE\", \"newyeartest2\", \"mykeyspace\", \"CREATE TABLE newyeartest2 (a int,b int,c int,PRIMARY KEY (a, b, c))\", \"152.59.69.211:0\", \"cassandra\", \"false\"",
"severity" => 5,
"type" => "db"
}