Configuration
ColdBox Installation
Configuration
moduleSettings = {
"logstash" : {
// The name of this application, which will allow for grouping of logs
"applicationName" : getSystemSetting( "LOGSTASH_APPLICATION_NAME", server.coldfusion.productname eq "Lucee" ? getApplicationSettings().name : getApplicationMetadata().name ),
// Whether to enable the API endpoints to receive log messages
"enableAPI" : getSystemSetting( "LOGSTASH_ENABLE_API", true ),
// Whether to automatically enabled log appenders
"enableAppenders" : getSystemSetting( "LOGSTASH_ENABLE_APPENDERS", true ),
// The type of transmission mode for this module - `direct` or `api`
"transmission" : getSystemSetting( "LOGSTASH_TRANSMISSION_METHOD", "direct" ),
// only used if the transmission setting is `api`
"apiUrl" : getSystemSetting( "LOGSTASH_API_URL", "" ),
// Regex used to whitelist remote addresses allowed to transmit to the API - by default only 127.0.0.1 is allowed to transmit messages to the API
"apiWhitelist" : getSystemSetting( "LOGSTASH_API_WHITELIST", "127.0.0.1" ),
// a user-provided API token - which must match the token configured on the remote API microservice leave empty if using IP whitelisting
"apiAuthToken" : getSystemSetting( "LOGSTASH_API_TOKEN", "" ),
// Min/Max levels for the appender
"levelMin" : getSystemSetting( "LOGSTASH_LEVEL_MIN", "FATAL" ),
"levelMax" : getSystemSetting( "LOGSTASH_LEVEL_MAX", "ERROR" ),
// A closure, which may be used in the configuration to provide custom information. Will be stored in the `userinfo` key in your logstash logs
"userInfoUDF" : function(){ return {}; },
// The name of the data stream to use for the appender
"dataStream" : getSystemSetting( "LOGSTASH_DATASTREAM", "logs-coldbox-logstash-appender" ),
// The data stream pattern to use for index templates
"dataStreamPattern" : getSystemSetting( "LOGSTASH_DATASTREAM_PATTERN", "logs-coldbox-*" ),
// The name of the ILM policy for log rotation
"ILMPolicyName" : getSystemSetting( "LOGSTASH_ILMPOLICY", "cbelasticsearch-logs" ),
// Option full JSON representation of an ILM lifecycle policy
"lifecyclePolicy" : javacast( "null", 0 ),
// The name of the component template to apply
"componentTemplateName" : getSystemSetting( "LOGSTASH_COMPONENT_TEMPLATE", "cbelasticsearch-logs-mappings" ),
// The name of the index template to apply
"indexTemplateName" : getSystemSetting( "LOGSTASH_INDEX_TEMPLATE" "cbelasticsearch-logs" ),
// Retention of logs in number of days
"retentionDays" : getSystemSetting( "LOGSTASH_RETENTION_DAYS", 365 ),
// The number of shards to use for new logstash indices
"indexShards" : getSystemSetting( "LOGSTASH_INDEX_SHARDS", 1 ),
// The number of replicas to use for new logstash indexes
"indexReplicas" : getSystemSetting( "LOGSTASH_INDEX_REPLICAS", 0 ),
// Backward compatiblility keys for migrating old rotational indices
"indexPrefix" : getSystemSetting( "LOGSTASH_INDEX_PREFIX", "" ),
"migrateIndices" : getSystemSetting( "LOGSTASH_MIGRATE_V2", false ),
// Whether to throw an error when a log document fails to save
"throwOnError" : true,
// An array of detached appenders which can be used with the `writeToAppender` interception point or directly through the elasticsearch module AppenderService
"detachedAppenders" : [
{
"name" : "myCustomAppender",
"properties" : {
"retentionDays" : 1,
// The name of the application which will be transmitted with the log data and used for grouping
"applicationName" : "Custom Detached Appender Logs",
// The max shard size at which the hot phase will rollover data
"rolloverSize" : "1gb"
}
}
]
}
}Transmission Modes
Direct
API
Microservice configuration
Custom Lifcycle Policy
User Info Closure
Index naming conventions
Last updated