I'm receiving the following error & some of my incoming logs are being not being parsed and therefore dropped.
[2021-11-22T09:50:11,381][WARN ][logstash.filters.csv ][MID-CUCM][6a45eeb30e5ba587e03ab6fc5b123b705e6e76c0996435d0b427c2741d24c7f8] Error parsing csv {:field=>"message", :source=>"C8A5A0662CEF69\",3,\"00000000005B43B9021E173B00000000\",0,0,0,\"\",\"\",2,\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",0,0,\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",0,0,0,\"5634\",\"5634\",\"5634\",\"\"", :exception=>#<CSV::MalformedCSVError: Illegal quoting in line 1.>}
Here's that same line broken out a bit:
[2021-11-22T09:50:11,381][WARN ][logstash.filters.csv ][MID-CUCM][6a45eeb30e5ba587e03ab6fc5b123b705e6e76c0996435d0b427c2741d24c7f8]
Error parsing csv
{:field=>"message",
:source=>"C8A5A0662CEF69\",
3,
\"00000000005B43B9021E173B00000000\",
0,
0,
0,
\"\",
\"\",
2,
\"\",
\"\",
\"\",
\"\",
\"\",
\"\",
\"\",
\"\",
0,
0,
\"\",
\"\",
\"\",
\"\",
\"\",
\"\",
\"\",
\"\",
0,
0,
0,
\"5634\",
\"5634\",
\"5634\",
\"\"",
:exception=>#<CSV::MalformedCSVError: Illegal quoting in line 1.>}
Here's my config file:
input {
file {
path =>"/sftp/etcsftp/incoming/cdr*"
type => "cucm-cdr"
add_field => { "cucm_clustername" => "CUCM_Cluster_1" }
}
}
filter {
if [type] == "cucm-cdr"{
if ([message] =~ /^\"cdrRecordType/) {
drop{}
}
if ([message] =~ /^INTEGER/) {
drop{}
}
csv {
columns => ["cdrRecordType","globalCallID_callManagerId","globalCallID_callId","origLegCallIdentifier","dateTimeOrigination","origNodeId","origSpan","origIpAddr","callingPartyNumber","callingPartyUnicodeLoginUserID","origCause_location","origCause_value","origPrecedenceLevel","origMediaTransportAddress_IP","origMediaTransportAddress_Port","origMediaCap_payloadCapability","origMediaCap_maxFramesPerPacket","origMediaCap_g723BitRate","origVideoCap_Codec","origVideoCap_Bandwidth","origVideoCap_Resolution","origVideoTransportAddress_IP","origVideoTransportAddress_Port","origRSVPAudioStat","origRSVPVideoStat","destLegIdentifier","destNodeId","destSpan","destIpAddr","originalCalledPartyNumber","finalCalledPartyNumber","finalCalledPartyUnicodeLoginUserID","destCause_location","destCause_value","destPrecedenceLevel","destMediaTransportAddress_IP","destMediaTransportAddress_Port","destMediaCap_payloadCapability","destMediaCap_maxFramesPerPacket","destMediaCap_g723BitRate","destVideoCap_Codec","destVideoCap_Bandwidth","destVideoCap_Resolution","destVideoTransportAddress_IP","destVideoTransportAddress_Port","destRSVPAudioStat","destRSVPVideoStat","dateTimeConnect","dateTimeDisconnect","lastRedirectDn","pkid","originalCalledPartyNumberPartition","callingPartyNumberPartition","finalCalledPartyNumberPartition","lastRedirectDnPartition","duration","origDeviceName","destDeviceName","origCallTerminationOnBehalfOf","destCallTerminationOnBehalfOf","origCalledPartyRedirectOnBehalfOf","lastRedirectRedirectOnBehalfOf","origCalledPartyRedirectReason","lastRedirectRedirectReason","destConversationId","globalCallId_ClusterID","joinOnBehalfOf","comment","authCodeDescription","authorizationLevel","clientMatterCode","origDTMFMethod","destDTMFMethod","callSecuredStatus","origConversationId","origMediaCap_Bandwidth","destMediaCap_Bandwidth","authorizationCodeValue","outpulsedCallingPartyNumber","outpulsedCalledPartyNumber","origIpv4v6Addr","destIpv4v6Addr","origVideoCap_Codec_Channel2","origVideoCap_Bandwidth_Channel2","origVideoCap_Resolution_Channel2","origVideoTransportAddress_IP_Channel2","origVideoTransportAddress_Port_Channel2","origVideoChannel_Role_Channel2","destVideoCap_Codec_Channel2","destVideoCap_Bandwidth_Channel2","destVideoCap_Resolution_Channel2","destVideoTransportAddress_IP_Channel2","destVideoTransportAddress_Port_Channel2","destVideoChannel_Role_Channel2","IncomingProtocolID","IncomingProtocolCallRef","OutgoingProtocolID","OutgoingProtocolCallRef","currentRoutingReason","origRoutingReason","lastRedirectingRoutingReason","huntPilotPartition","huntPilotDN","calledPartyPatternUsage","IncomingICID","IncomingOrigIOI","IncomingTermIOI","OutgoingICID","OutgoingOrigIOI","OutgoingTermIOI","outpulsedOriginalCalledPartyNumber","outpulsedLastRedirectingNumber","wasCallQueued","totalWaitTimeInQueue","callingPartyNumber_uri","originalCalledPartyNumber_uri","finalCalledPartyNumber_uri","lastRedirectDn_uri"]
separator => ","
}
if "_csvparsefailure" in [tags] {
drop{}
}
if "_dateparsefailure" in [tags] {
drop{}
}
mutate {
convert => [ "duration", "integer" ]
}
mutate {
add_field => ["dateTimeImport", "%{@timestamp}"]
}
date {
match => ["dateTimeOrigination", "UNIX"]
}
date {
match => ["dateTimeOrigination", "UNIX"]
target => "dateTimeOrigination_formatted"
}
date {
match => ["dateTimeConnect", "UNIX"]
target => "dateTimeConnect_formatted"
}
date {
match => ["dateTimeDisconnect", "UNIX"]
target => "dateTimeDisconnect_formatted"
}
translate {
source => "destMediaCap_payloadCapability"
target => "destMediaCap_payloadCapability_text"
dictionary => [
"0","NoCodec",
"1","NonStandard",
"2","G711Alaw 64k",
"3","G711Alaw 56k",
"4","G711mu-law 64k",
"5","G711mu-law 56k",
"6","G722 64k",
"7","G722 56k",
"8","G722 48k",
"9","G7231",
"10","G728",
"11","G729",
"12","G729AnnexA",
"13","Is11172AudioCap",
"14","Is13818AudioCap",
"15","G.729AnnexB",
"16","G.729 Annex AwAnnexB",
"18","GSM Full Rate",
"19","GSM Half Rate",
"20","GSM Enhanced Full Rate",
"25","Wideband 256K",
"32","Data 64k",
"33","Data 56k",
"40","G7221 32K",
"41","G7221 24K",
"42","AAC",
"80","GSM",
"81","ActiveVoice",
"82","G726_32K",
"83","G726_24K",
"84","G726_16K",
"86","iLBC",
"89","iSAC",
"100","H261",
"101","H263",
"102","Vieo",
"103","H264",
"106","H224"
]
}
}
translate {
source => "destDeviceName"
target => "destDeviceName_Friendly"
dictionary_path => "/opt/logstash/patterns/mid-cucm_destdevicenamefriendly.yaml"
fallback => "Other Phone Answered"
refresh_interval => 300
}
translate {
source => "finalCalledPartyNumber"
target => "finalCalledPartyNumber_Friendly"
dictionary_path => "/opt/logstash/patterns/mid-cucm_finalcalledpartynumber_friendly.yaml"
fallback => "Other Phone Answered"
refresh_interval => 300
}
}
output {
elasticsearch {
hosts => ""
user => ""
password => ""
ilm_rollover_alias => "network-cisco-cucm-mid"
ilm_pattern => "001"
ilm_policy => "mid-cucm-ilm"
}
}