@type tail
@id access_service_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/access-service.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/access-service.log.pos"
tag jfrog.rt.access.service
@type none
@type tail
@id artifactory_service_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/artifactory-service.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/artifactory-service.log.pos"
tag jfrog.rt.artifactory.service
@type none
@type tail
@id frontend_service_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/frontend-service.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/frontend-service.log.pos"
tag jfrog.rt.frontend.service
@type none
@type tail
@id metadata_service_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/metadata-service.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/metadata-service.log.pos"
tag jfrog.rt.metadata.service
@type none
@type tail
@id router_service_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/router-service.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/router-service.log.pos"
tag jfrog.rt.router.service
@type none
# Strip out color codes then field extract the service fields
@type record_transformer
enable_ruby true
message ${record["message"].gsub(/\e\[([;\d]+)?m/, '')}
@type parser
key_name message
@type multiline
format_firstline /\d{4}-\d{1,2}-\d{1,2}/
format1 /^(?[^ ]*) \[(?[^\]]*)\] \[(?[^\]]*)\] \[(?[^\]]*)\] \[(?.*)\] \[(?.*)\] -(?.*)$/
# End Service Fields Extraction
@type tail
@id router_traefik_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/router-traefik.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/router-traefik.log.pos"
tag jfrog.rt.router.traefik
@type multiline
format_firstline /\d{4}-\d{1,2}-\d{1,2}/
format1 /^(?[^ ]*) \[(?[^\]]*)\] \[(?[^\]]*)\] \[(?[^\]]*)\] \[(?.*)\] \[(?.*)\] -(?.*)$/
@type tail
@id access_request_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/access-request.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/access-request.log.pos"
tag jfrog.rt.access.request
@type regexp
expression ^(?[^ ]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?.+)$
@type tail
@id artifactory_request_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/artifactory-request.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/artifactory-request.log.pos"
tag jfrog.rt.artifactory.request
@type regexp
expression ^(?[^ ]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?.+)$
@type record_transformer
enable_ruby true
repo ${record["request_url"].include?("/api/docker") && !record["request_url"].include?("/api/docker/null") && !record["request_url"].include?("/api/docker/v2") ? (record["request_url"].split('/')[3]) : ("")}
image ${record["request_url"].include?("/api/docker") && !record["request_url"].include?("/api/docker/null") && !record["request_url"].include?("/api/docker/v2") ? (record["request_url"].split('/')[5]) : ("")}
@type tail
@id frontend_request_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/frontend-request.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/frontend-request.log.pos"
tag jfrog.rt.frontend.request
@type regexp
expression ^(?[^ ]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?.+)$
@type tail
@id metadata_request_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/metadata-request.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/metadata-request.log.pos"
tag jfrog.rt.metadata.request
@type regexp
expression ^(?[^ ]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?[^\|]*)\|(?.+)$
@type tail
@id router_request_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/router-request.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/router-request.log.pos"
tag jfrog.rt.router.request
@type json
@type tail
@id artifactory_access_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/artifactory-access.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/artifactory-access.log.pos"
tag jfrog.rt.artifactory.access
@type regexp
expression /^(?[^ ]*) \[(?[^\]]*)\] \[(?[^\]]*)\] (?.*) for client : (?.+)/(?.+).$/
@type tail
@id access_security_audit_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/access-security-audit.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/access-security-audit.log.pos"
tag jfrog.rt.access.audit
@type regexp
expression /^(?[^ ]*)\|(?[^ ]*)\|(?[^ ]*)\|(?[^ ]*)\|(?[^ ]*)\|(?[^ ]*)\|(?[^ ]*)\|(?[^ ]*)\|(?.*)/
@type record_transformer
hostname "#{Socket.gethostname}"
log_source ${tag}
@type exec
tag jfrog.callhome
command "curl --request GET 'http://localhost:8081/artifactory/api/system/version' -H 'Authorization: Bearer '"
run_interval 1d
@type json
@type record_transformer
renew_record true
keep_keys 'productId,features'
enable_ruby true
productId 'jfrogLogAnalyticsElastic/0.9.0'
features ${return([{"featureId" => "ArtifactoryVersion/" + record["version"]}])}
@type http
endpoint http://localhost:8081/artifactory/api/system/usage
open_timeout 5
content_type application/json
headers {"Authorization":"Bearer "}
@type json
flush_interval 5s
@type record_transformer
enable_ruby true
repo ${record["request_url"].include?("/api/docker") && !record["request_url"].include?("/api/docker/null") && !record["request_url"].include?("/api/docker/v2") ? (record["request_url"].split('/')[3]) : ("")}
image ${record["request_url"].include?("/api/docker") && !record["request_url"].include?("/api/docker/null") && !record["request_url"].include?("/api/docker/v2") ? (record["request_url"].split('/')[5]) : ("")}
@type record_transformer
enable_ruby true
response_content_length_2 ${record["response_content_length"].to_f}
request_content_length_2 ${record["request_content_length"].to_f}
###JFROG METRICS Plugin
@type jfrog_metrics
@id metrics_http_jfrt
tag jfrog.metrics.artifactory
interval 5s
metric_prefix 'jfrog.artifactory'
jpd_url "#{ENV['JF_JPD_URL']}"
username "#{ENV['JF_JPD_USER_NAME']}"
apikey "#{ENV['JF_JPD_API_KEY']}"
token "#{ENV['JF_JPD_TOKEN']}"
target_platform "ELASTIC"
########################
# ELASTIC OUTPUT METRICS
########################
@type elasticsearch
@id elasticsearch_metrics
host "#{ENV['ELASTIC_HOST']}"
port "#{ENV['ELASTIC_PORT']}"
user "#{ENV['ELASTIC_USER']}"
password "#{ENV['ELASTIC_PASSWORD']}"
scheme "#{ENV['ELASTIC_SCHEME']}"
ssl_verify "#{ENV['ELASTIC_SSL_VERIFY']}"
index_name unified-metrics-artifactory
include_tag_key true
type_name fluentd
logstash_format false
include_timestamp true
#END ELASTIC OUTPUT
########################
# ELASTIC OUTPUT LOGS
########################
@type elasticsearch
@id elasticsearch_logs
host "#{ENV['ELASTIC_HOST']}"
port "#{ENV['ELASTIC_PORT']}"
user "#{ENV['ELASTIC_USER']}"
password "#{ENV['ELASTIC_PASSWORD']}"
scheme "#{ENV['ELASTIC_SCHEME']}"
ssl_verify "#{ENV['ELASTIC_SSL_VERIFY']}"
index_name unified-artifactory
include_tag_key true
type_name fluentd
logstash_format false
#END ELASTIC OUTPUT