---
title: Sending Metrics with the Periodic Stats Logger and the Splunk Universal Forwarder
description: Send PingDirectory metrics to Splunk by enabling the Periodic Stats Logger and configuring a Splunk Universal Forwarder to monitor the dsstats.json file.
component: pingdirectory
version: 11.1
page_id: pingdirectory:pingdirectory_server_administration_guide:pd_ds_send_metrics_periodic_stats_logger_splunk_univ_forwarder
canonical_url: https://docs.pingidentity.com/pingdirectory/11.1/pingdirectory_server_administration_guide/pd_ds_send_metrics_periodic_stats_logger_splunk_univ_forwarder.html
llms_txt: https://docs.pingidentity.com/pingdirectory/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
revdate: September 13, 2023
page_aliases: ["pd_ds_config_periodic_stats_logger.adoc", "pd_ds_config_splunk_universal_forwarder.adoc"]
section_ids:
  configuring-the-periodic-stats-logger: Configuring the Periodic Stats Logger
  about-this-task: About this task
  configuring-the-splunk-universal-forwarder: Configuring the Splunk Universal Forwarder
  about-this-task-2: About this task
---

# Sending Metrics with the Periodic Stats Logger and the Splunk Universal Forwarder

A Splunk Universal Forwarder can be used to forward PingDirectory server events to Splunk.

The Periodic Stats Logger plugin writes PingDirectory server metrics to a file in the server root. A Splunk Universal Forwarder can be configured to watch this file and forward the metrics to Splunk.

## Configuring the Periodic Stats Logger

The PingDirectory server can log various metrics, including LDAP operation counts and GC activity, to a JSON-formatted log.

### About this task

To configure the PingDirectory server to log to a JSON-formatted log file with various metrics, including LDAP operation counts and GC activity, run the following command. The metrics will be written to `logs/dsstats.json` in the server root.

```
dsconfig set-plugin-prop \
         --plugin-name "Stats Logger" \
         --set enabled:true \
         --set log-file:logs/dsstats.json \
         --set log-file-format:json \
         --set local-db-backend-info:extended \
         --set header-prefix-per-column:true \
		 --set empty-instead-of-zero:false \
		 --set per-application-ldap-stats:per-application-and-aggregate
```

## Configuring the Splunk Universal Forwarder

You can use the Splunk Universal Forwarder to monitor the `logs/dsstats.json` file and forward the metrics to Splunk.

### About this task

The Splunk Universal Forwarder can be configured to monitor the `logs/dsstats.json` file and forward the metrics to Splunk. Under the Splunk Forwarder application files, update the `etc/apps/search/local/inputs.conf` file with the following configuration for `dsstats.json`:

```
[monitor:///path/to/PingDirectory/logs/dsstats.json]
			sourcetype=log2metrics_json
			index=pdmetrics
			disabled=false
			host=pd1
```

The index name can be customized, and the host value can be configured to label where the metrics are being forwarded from.
