Configure Universal Forwarder

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

Supported Version

Universal Forwarder version >= 7.0.0

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:
    CODE
    [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 を指定します。

CODE
[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 の場合、次のようにスタンザを更新します。

CODE
[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 をクリックします。

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