Configure Universal Forwarder

You must configure the Splunk Universal Forwarderto send the application metadata from Splunk AppDynamics SaaS to Splunk Platform for application context correlation.

Supported Version

Universal Forwarder version >= 7.0.0

Before You Begin

Ensure the following:

  • You must have an universal forwarder already deployed in your environment. For more information about the deployment, see the Splunk Documentation.
  • The universal forwarder must be functioning properly and sending logs to Splunk Platform. If there are any issues, contact Splunk Support.

Configuration

To configure your universal forwarder for log observer connect for Splunk AppDynamics SaaS :

  1. In the $SPLUNK_HOME/etc/system/local/ directory, open the inputs.conf file. If the file is not available, create a file with the name inputs.conf . For specification, see inputs.conf.spec.
  2. In each monitor stanza, add the _meta field.
  3. In _meta field, add the AppDynamics application name and the tier name. The following sample displays a stanza in the inputs.conf file that collect logs from the directory /var/log/my-app:
    [monitor:///var/log/my-app]
    index = <index-name>
    disabled = 0
    _meta = appd_app_name::<APPD_APP_NAME> appd_tier_name::<APPD_TIER_NAME>
  4. Restart your Splunk instance to enable the configuration changes.
Warning: For logs to get parsed and indexed properly with respect to the injected meta data, you must properly configure event line breaking. Multiline logs must be handled correctly so that they do not get split up into multiple events. Also, multiple logs must not add together into one event. For information on how to configure line breaking, see the Splunk Documentation.

構造化ログの追加設定

構造化ログのログ接続を有効にするには、ユニバーサルフォワーダーで次のソースタイプのいずれかを設定します。

事前設定されていないソースタイプ

構造化ログのソースタイプが事前設定されていない場合は、inputs.conf ファイルでソースタイプを指定する必要があります。
  1. 構造ログファイルを含む各スタンザで、構造化ログのフォーマットを指定します。次のフォーマットがサポートされています。
    形式
    カンマ区切り値csv
    JSON_json
    パイプ区切り値psv
    タブ区切り値tsv
  2. ユニバーサルフォワーダを再起動します。

たとえば、構造化ログが JSON フォーマットの場合は、次のようにスタンザで sourcetype _json を指定します。

[monitor:///var/log/my-app]
index = <index-name>
sourcetype=_json
disabled = 0
_meta = appd_app_name::<APPD_APP_NAME> appd_tier_name::<APPD_TIER_NAME>

事前設定されたソースタイプ

構造化ログのカスタムソースタイプをすでに設定しているが、インデックスされたフィールドの抽出が有効になっていない場合は、ユニバーサルフォワーダーの props.conf を更新し、Splunk インスタンスで適切なインデックス抽出を選択する必要があります。

ユニバーサルフォワーダで、次の手順を実行します。

  1. $SPLUNK_HOME/etc/system/local/props.conf に移動します。

  2. 次のいずれかのフォーマットを指定して、スタンザを更新して INDEXED_EXTRACTIONS を有効にします。
    • CSV

    • JSON

    • TSV

    • PSV

    • W3C

  3. ユニバーサルフォワーダを再起動します。

たとえば、カスタムソースタイプが custom-json の場合、次のようにスタンザを更新します。

[custom-json]
INDEXED_EXTRACTIONS = JSON

Splunk インスタンスで次の手順を実行します。

  1. [設定(Settings)] > [データ(Data)] > [ソースタイプ(Source Types)] をクリックします。

  2. [新しいソースタイプ(New Source Type)] をクリックします。

  3. [名前(Name)] フィールドで、UF で言及した名前と同じカスタムソースタイプ名を指定します。例:custom-json

  4. [説明(Description)] フィールドに、ソースタイプの適切な説明を入力します。

  5. [Destination app] リストで、アプリケーションに system を選択します。
    重要: Classic Experience で Splunk Cloud Platform または Splunk Enterprise の展開を使用している場合は、接続先アプリケーションリストを選択できます。Victoria Experience の Splunk Cloud Platform の場合、接続先アプリケーションはデフォルトで 000-self-service に設定されます。000-self-service アプリケーションの Global へのオブジェクト共有を有効にするには、Splunk 管理者にお問い合わせください。
  6. [Category] リストで、カテゴリに Structured を選択します。

  7. [インデックス付き抽出(Indexed extraction)] リストで、カスタムソースタイプのフォーマットを選択します。形式は次のいずれかになります。
    • CSV

    • JSON

    • TSV

    • PSV

    • W3C

  8. [詳細(Advanced)] をクリックし、[新しい設定(New setting)] を追加します。

  9. [ KV_MODE] リストで、値に none を選択します。
  10. [Save] をクリックします。

次のイメージは、ソースタイプの例を示しています。