input {
tcp {
port => 5000
codec => json
}
}
output {
if [appName] =="user-service"{
elasticsearch {
hosts => ["http://localhost:9200"]
index => "micro-%{appName}%{+YYYY.MM.dd}" # Use date-based index names
ilm_enabled => true # Enable ILM
ilm_rollover_alias => "user-service" # Define an alias for the rollover
}
}
else if [appName] == "vehicle-service" {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "micro-%{appName}%{+YYYY.MM.dd}"
ilm_enabled => true # Enable ILM
ilm_rollover_alias => "vehicle-service" # Define an alias for the rollover
}
}
else if [appName] == "search-service" {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "micro-%{appName}%{+YYYY.MM.dd}"
ilm_enabled => true # Enable ILM
ilm_rollover_alias => "search-service" # Define an alias for the rollover
}
}
else if [appName] == "common-service" {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "micro-%{appName}%{+YYYY.MM.dd}"
ilm_enabled => true # Enable ILM
ilm_rollover_alias => "common-service" # Define an alias for the rollover
}
}
else if [appName] == "api-gateway" {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "micro-%{appName}%{+YYYY.MM.dd}"
ilm_enabled => true # Enable ILM
ilm_rollover_alias => "api-gateway" # Define an alias for the rollover
}
}
else if [appName] == "asset-service" {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "micro-%{appName}%{+YYYY.MM.dd}"
ilm_enabled => true # Enable ILM
ilm_rollover_alias => "asset-service" # Define an alias for the rollover
}
}
else if [appName] == "booking-service" {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "micro-%{appName}%{+YYYY.MM.dd}"
ilm_enabled => true # Enable ILM
ilm_rollover_alias => "booking-service" # Define an alias for the rollover
}
}
else if [appName] == "discovery-server" {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "micro-%{appName}%{+YYYY.MM.dd}"
ilm_enabled => true # Enable ILM
ilm_rollover_alias => "discovery-server" # Define an alias for the rollover
}
}
else if [appName] == "fare-service" {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "micro-%{appName}%{+YYYY.MM.dd}"
ilm_enabled => true # Enable ILM
ilm_rollover_alias => "fare-service" # Define an alias for the rollover
}
}
else if [appName] == "qr-service" {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "micro-%{appName}%{+YYYY.MM.dd}"
ilm_enabled => true # Enable ILM
ilm_rollover_alias => "qr-service" # Define an alias for the rollover
}
}
}