# outputs.conf module(load="omhttp") module(load="omstdout") ## TEMPLATES ## # Schema: "event-flatten:2" # Expects variables: # - $!data # Caller sets all subfields. template(name="tpl_event_flatten_v2" type="list") { constant(value="{\"schema_type\":\"json-schema\",\"schema_id\":\"event-flatten:2\",") constant(value="\"data\":") property(name="$!data") constant(value="}\n") } # Funnel Metric schema. # Expects variables: # - $!metric_service # - $!metric_name # - $!metric_tags # - $!metric_value # - $!metric_timestamp template(name="tpl_funnel_metrics" type="list") { constant(value="{") property(name="$!metric_service" outname="service" format="jsonfr") constant(value=",") constant(value="\"metricName\": [\"") property(name="$!metric_name") constant(value="\"],") constant(value="\"tags\":") property(name="$!metric_tags") constant(value=",") constant(value="\"metricValue\":") property(name="$!metric_value" format="json") constant(value=",") constant(value="\"timestamp\":") property(name="$!metric_timestamp" format="json") constant(value="}\n") } template(name="tpl_echo" type="string" string="%msg%") template(name="tpl_dynafile" type="list") { constant(value="/www/data/") property(name="$.dynadir") constant(value="/") property(name="$.app_id") constant(value=".") # App ID or Drain Token. property(name="$.source") constant(value=".") # Source. property(name="$.dyno") constant(value=".log") # Dyno. } template(name="tpl_dynafile_metrics" type="list") { constant(value="/www/data/") property(name="$.dynadir") constant(value="/") property(name="$!metric_service") constant(value="/") property(name="$!metric_name") constant(value="/") property(name="$!metric_tags!device") constant(value=".") property(name="$!metric_tags!source") constant(value=".") property(name="$!metric_tags!dyno") constant(value=".log") } ############## ## RULESETS ## ############## ruleset(name="rs_logger") { action( type="omstdout" name="action_logger_omstdout" ) } ruleset(name="rs_funnel_dnr_logs") { set $.dynadir = "funnel-dnr"; action( type="omfile" template="tpl_event_flatten_v2" dynafile="tpl_dynafile" ) action( name="action_omhttp_funnel_dnr_logs" type="omhttp" queue.size="100000" queue.dequeueBatchSize="10000" queue.minDequeueBatchSize="10000" queue.minDequeueBatchSize.timeout="10000" queue.workerthreads="1" template="tpl_event_flatten_v2" server="funnel.funnelapi.foundation.aws-prod1-useast1.aws.sfdc.cl" serverport="443" checkpath="funnel/ping" restpath="v1/logs/v1/dnr/heroku/v1" httpcontenttype="application/vnd.kafka.json.v1+json" batch.format="jsonarray" batch="on" batch.maxsize="10000" batch.maxbytes="10000000" tls.cacert="/dev/shm/identity/ca/cacerts.pem" tls.mycert="/dev/shm/identity/client/certificates/client.pem" tls.myprivkey="/dev/shm/identity/client/keys/client-key.pem" usehttps="on" compress="on" retry="on" retry.ruleset="rs_funnel_dnr_logs_retry" ) } ruleset(name="rs_funnel_dnr_logs_retry") { action( name="action_omhttp_funnel_dnr_logs_retry" type="omhttp" queue.size="1000" queue.dequeueBatchSize="1000" queue.minDequeueBatchSize="500" queue.minDequeueBatchSize.timeout="1000" template="tpl_echo" server="funnel.funnelapi.foundation.aws-prod1-useast1.aws.sfdc.cl" serverport="443" checkpath="funnel/ping" restpath="v1/logs/v1/dnr/heroku/v1" httpcontenttype="application/vnd.kafka.json.v1+json" batch.format="jsonarray" batch="on" batch.maxsize="10000" batch.maxbytes="10000000" tls.cacert="/dev/shm/identity/ca/cacerts.pem" tls.mycert="/dev/shm/identity/client/certificates/client.pem" tls.myprivkey="/dev/shm/identity/client/keys/client-key.pem" usehttps="on" compress="on" retry="on" retry.ruleset="rs_funnel_dnr_logs_retry" ) } ruleset(name="rs_funnel_logs") { set $.dynadir = "funnel-logs"; action( type="omfile" template="tpl_event_flatten_v2" dynafile="tpl_dynafile" ) action( name="action_omhttp_funnel_logs" type="omhttp" queue.size="100000" queue.dequeueBatchSize="10000" queue.minDequeueBatchSize="10000" queue.minDequeueBatchSize.timeout="10000" queue.workerthreads="1" template="tpl_event_flatten_v2" server="funnel.funnelapi.foundation.aws-prod1-useast1.aws.sfdc.cl" serverport="443" checkpath="funnel/ping" restpath="v1/data/namespaces/sfdc.prod.sumo.logs/topics/logs.ext" httpcontenttype="application/vnd.kafka.v1+json" batch.format="kafkarest" batch="on" batch.maxsize="10000" batch.maxbytes="10000000" tls.cacert="/dev/shm/identity/ca/cacerts.pem" tls.mycert="/dev/shm/identity/client/certificates/client.pem" tls.myprivkey="/dev/shm/identity/client/keys/client-key.pem" usehttps="on" compress="on" retry="on" retry.ruleset="rs_funnel_logs_retry" ) } ruleset(name="rs_funnel_logs_retry") { action( name="action_omhttp_funnel_logs_retry" type="omhttp" queue.size="1000" queue.dequeueBatchSize="1000" queue.minDequeueBatchSize="500" queue.minDequeueBatchSize.timeout="1000" template="tpl_echo" server="funnel.funnelapi.foundation.aws-prod1-useast1.aws.sfdc.cl" serverport="443" checkpath="funnel/ping" restpath="v1/data/namespaces/sfdc.prod.sumo.logs/topics/logs.ext" httpcontenttype="application/vnd.kafka.v1+json" batch.format="kafkarest" batch="on" batch.maxsize="10000" batch.maxbytes="10000000" tls.cacert="/dev/shm/identity/ca/cacerts.pem" tls.mycert="/dev/shm/identity/client/certificates/client.pem" tls.myprivkey="/dev/shm/identity/client/keys/client-key.pem" usehttps="on" compress="on" retry="on" retry.ruleset="rs_funnel_logs_retry" ) } ruleset(name="rs_funnel_metrics") { set $.dynadir = "funnel-metrics"; action( type="omfile" template="tpl_funnel_metrics" dynafile="tpl_dynafile_metrics" ) action( name="action_omhttp_funnel_metrics" type="omhttp" queue.size="10000" queue.dequeueBatchSize="1000" queue.minDequeueBatchSize="500" queue.minDequeueBatchSize.timeout="1000" template="tpl_funnel_metrics" server="ajna-api.salesforce.com" serverport="443" checkpath="funnel/ping" restpath="v1/metrics/v2" httpcontenttype="application/json" batch.format="jsonarray" batch="on" batch.maxsize="500" batch.maxbytes="1000000" tls.cacert="/dev/shm/identity/ca/cacerts.pem" tls.mycert="/dev/shm/identity/client/certificates/client.pem" tls.myprivkey="/dev/shm/identity/client/keys/client-key.pem" usehttps="on" compress="on" retry="off" ) }