Outcold Solutions - Monitoring Kubernetes, OpenShift and Docker in Splunk

Monitoring OpenShift

Splunk Indexes

By default, collectorforopenshift forwards all the events to the default index specified for the HTTP Event Collector Token. Every HTTP Event Collector Token has a list of indexes where this specific Token can write data. One of the indexes from this list is also used as the default index when the sender of the data does not specify a target index. The application assumes that you are writing data to the indexes that are searchable by default by your Splunk Role. As an example, the main index is searchable by default.

If you used a different index that isn’t searchable by default by your Splunk Role, you would not see data on the dashboards.

To fix that, you can include this index in the Indexes searched by default for your role under Settings - Access Control

  • Roles
Splunk - Indexes searched by default

Or you can change the Search Macros we use in the application and include a list of indexes you use for the Monitoring OpenShift events. You can find search macros in the Splunk Web UI under Settings - Advanced search

  • Search macros (or by overriding $SPLUNK_HOME/etc/apps/monitoringopenshift/default/macros.conf with $SPLUNK_HOME/etc/apps/monitoringopenshift/local/macros.conf).
Monitoring OpenShift - Macros

Starting from version 5.10, we include a base macro macro_openshift_base, where you can include the list of indexes only once; all other macros will use this configuration. For example

macro_openshift_base = (index=openshift_stats OR index=openshift_logs)

If you want to have more precise configurations, you can modify specific macros.

macro_openshift_stats = (index=openshift_stats sourcetype=openshift_stats)

You only need to update macros

  • macro_openshift_events - all the OpenShift events.
  • macro_openshift_host_logs - host logs.
  • macro_openshift_logs - container logs.
  • macro_openshift_proc_stats - proc metrics.
  • macro_openshift_net_stats - network metrics.
  • macro_openshift_net_socket_table - network socket tables.
  • macro_openshift_mount_stats - container runtime storage usage metrics.
  • macro_openshift_stats - system and container metrics.

Using dedicated indexes for different types of data

Considering the application access patterns and the content of the events, we recommend splitting logs from metrics and using dedicated indexes. For example, openshift_logs for events, container and host logs; openshift_stats for proc and system metrics; and openshift_prometheus for Prometheus metrics. You can also specify a dedicated index for every type of data the collectord forwards.

Using dedicated indexes also allows you to specify different retention policies for logs and metrics.

You can do that by using the Configuration Reference file and uncommenting the highlighted lines with the values of the indexes you want to use as the destination.

data:
  collector.conf: |
    ...
    
    [input.system_stats]
    
    ...
    
    # specify Splunk index
    index = 
    
    ...
    
    [input.proc_stats]
    
    ...
    
    # specify Splunk index
    index = 
    
    ...
    
    [input.net_stats]
    
    ...
    
    # specify Splunk index
    index = 
    
    ...
    
    [input.net_socket_table]
    
    ...
    
    [input.mount_stats]
    
    ...
    
    # specify Splunk index
    index = 
    
    ...
    
    # specify Splunk index
    index = 
    
    ...
    
    [input.files]
    
    ...
    
    # specify Splunk index
    index = 
    
    ...
    
    [input.files::syslog]
    
    ...
    
    # specify Splunk index
    index =

    ...
    
    [input.files::logs]
    
    ...
    
    # specify Splunk index
    index =
    
    ...
    
    [input.kubernetes_events]
    
    ...
    
    # specify Splunk index
    index =
    
    ...

Configuring dedicated indexes, source and sourcetype for Projects

You can also override targeted indexes for Projects in OpenShift. The collectord watches for annotations on the projects, workloads, and pods. For example, if you want to specify that you want to index all container logs, metrics, and events in the specific project project1 to index openshift_project1, you can annotate this project with

oc annotate namespaces project1 \
  collectord.io/index=openshift_project1

You can learn more about the available annotations at Annotations


About Outcold Solutions

Outcold Solutions provides solutions for monitoring Kubernetes, OpenShift and Docker clusters in Splunk Enterprise and Splunk Cloud. We offer certified Splunk applications, which give you insights across all container environments. We are helping businesses reduce complexity related to logging and monitoring by providing easy-to-use and easy-to-deploy solutions for Linux and Windows containers. We deliver applications, which help developers monitor their applications and help operators keep their clusters healthy. With the power of Splunk Enterprise and Splunk Cloud, we offer one solution to help you keep all the metrics and logs in one place, allowing you to quickly address complex questions on container performance.