apiVersion: v1
# ===============LICENSE_START=======================================================
# Acumos Apache-2.0
# ===================================================================================
# Copyright (C) 2019 Nordix Foundation
# Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
# ===================================================================================
# This Acumos software file is distributed by Nordix Foundation and AT&T
# under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ===============LICENSE_END=========================================================
#
# What this is: Kubernetes configmap template for nginx as deployed with
# Acumos models in kubernetes environments, for logging of model events.
#
# Usage: intended to be customized and created for the specific deployment by
# deploy.sh
#

kind: ConfigMap
metadata:
  name: filebeat-config-<NAMESPACE>
  namespace: <NAMESPACE>
  labels:
    app: filebeat
data:
  filebeat-<NAMESPACE>.yml: |-
    filebeat.prospectors:
      - type: log
        paths:
          - /var/log/nginx/<NAMESPACE>/model-usage-*.log
        tags: [ "acumos-model-usage-logs" ]
        close_inactive: 20m
        json.keys_under_root: true

    # output.console:
    #   pretty: true

    output.logstash:
      hosts: ["<LOGSTASH_HOST>:<LOGSTASH_PORT>"]
