logstash/conf.d/cdr.conf
2025-02-18 16:02:34 +03:00

108 lines
3.4 KiB
Plaintext

input { pipeline { address => "Simfony_CDR" } }
filter {
csv {
columns => [
"Timestamp",
"Units",
"Access",
"Param1_TelserviceCode",
"Param2_Tadig",
"Param3_Country",
"Param4_Zone",
"Param5_Destination",
"Param6_LAC",
"Param7_CID",
"Param8_ChargingID",
"Param9_MVNOID",
"Param10_StartDate",
"Param11_EndDate",
"Param12",
"Param13",
"Param14",
"Param15_RatingGroup",
"Param16_SessionDuration",
"Param17",
"Param18",
"Param19_CDRType",
"ExtraParam1_PdpAddress",
"ExtraParam2_SessionId",
"ExtraParam3_CreditControlRequestType",
"ExtraParam4_CreditControlRequestNumber",
"ExtraParam5_Provider"
]
separator => ";"
}
date {
match => [ "Timestamp", "ISO8601" ]
target => "Timestamp"
}
date {
match => [ "Param10_StartDate", "ISO8601" ]
target => "Param10_StartDate"
}
date {
match => [ "Param11_EndDate", "ISO8601" ]
target => "Param11_EndDate"
}
mutate {
split => ["[host][name]", "."]
replace => ["[host][name]", "%{[host][name][0]}"]
rename => { "[host][name]" => "hostname" }
}
# Column28 is added because of the last delimiter ';'. No field intended. It has to be droped
mutate {
remove_field => [ "@timestamp" ]
remove_field => [ "Param12", "Param13", "Param14", "Param17", "Param18", "column28" ]
remove_field => [ "[agent]" ]
remove_field => [ "[ecs][version]" ]
remove_field => [ "[host][architecture]" ]
remove_field => [ "[host][containerized]" ]
remove_field => [ "[host][hostname]" ]
remove_field => [ "[host][name]" ]
remove_field => [ "[host][id]" ]
remove_field => [ "[host][mac]" ]
remove_field => [ "[host][os][name]" ]
remove_field => [ "[host][os][codename]" ]
remove_field => [ "[host][os][family]" ]
remove_field => [ "[host][os][kernel]" ]
remove_field => [ "[host][os][platform]" ]
remove_field => [ "[host][os][version]" ]
remove_field => [ "[host][os][family]" ]
remove_field => [ "[host][os][kernel]" ]
remove_field => [ "[log][offset]"]
}
}
output {
if "cdr" in [tags] {
elasticsearch {
hosts => ["http://10.12.174.15:9200","http://10.12.174.16:9200","http://10.12.174.17:9200"]
user => "logstash_internal"
password => "vK54tBEFUZaKBVtwsmlHksbr07Rm8cTn"
ilm_enabled => true
ilm_rollover_alias => "simfony-cdr"
ilm_policy => "simfony-cdr"
ilm_pattern => "{now/d}-000001"
}
}
else if "cdr-prepay" in [tags] {
elasticsearch {
hosts => ["http://10.12.174.15:9200","http://10.12.174.16:9200","http://10.12.174.17:9200"]
user => "logstash_internal"
password => "vK54tBEFUZaKBVtwsmlHksbr07Rm8cTn"
ilm_enabled => true
ilm_rollover_alias => "simfony-cdr-prepay"
ilm_policy => "simfony-cdr"
ilm_pattern => "{now/d}-000001"
}
}
}