LoginSignup
4
1

More than 1 year has passed since last update.

splunkの命名規約まとめメモ

Last updated at Posted at 2018-07-12

はじめに

どのソフトウェアでもそうですが、インストール前の状態から、ソフトウェアをインストールし、それが提供する機能を使える状態にするまでに、様々な設計要素を検討する必要があります。その設計要素の一つが名前やIDといった情報です。通常この設計要素を定義するとき、必ずソフトウェア側で決められた何らかの規則が伴いますが、splunkもまた同様で各設計要素に様々な規約があります。
業務で調べる機会があったのでまとめてみました。

※業務で使っていないものは割愛します...

インデックス名

A name for the index. User-defined index names must consist of only numbers, lowercase letters, underscores, and hyphens. They cannot begin with an underscore or hyphen, or contain the word "kvstore".

  • 数字、小文字、アンスコ、ハイフンを使用する。
  • アンダースコアまたはハイフンではじめることはできません。
  • "kvstore"を含む単語を含めることはできません。(予約語だから?)
  • 字数制限はなさそうです。

ソースタイプ名

公式ドキュメントの記載は特にみられませんでした。(2018/7/19時点)

カスタムフィールド名

正規表現を使用したフィールド抽出時のルールについて、以下のように記述されています。
https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Aboutregularexpressionswithfieldextractions#Proper_field_name_syntax

Field names must conform to the field name syntax rules.

Valid characters for field names are a-z, A-Z, 0-9, . , :, and _.
Field names cannot begin with 0-9 or _ . Leading underscores are reserved for Splunk Enterprise internal variables.

また、Splunkはデータ取り込み時にフィールドを抽出することもできるのですが(index-time-field)
この時のフィールドの命名ルールについて、以下のように記述されています。
https://docs.splunk.com/Documentation/Splunk/latest/Data/Configureindex-timefieldextraction#Field_name_syntax_restrictions

Field name syntax restrictions
You can assign field names as follows:
・ Valid characters for field names are a-z, A-Z, 0-9, or _ .
・Field names cannot begin with 0-9 or _ . Splunk reserves leading underscores for its internal variables.
・Avoid assigning field names that match any of the default field names.
・Do not assign field names that contain international characters.

  • フィールド名に使用できる文字は、数字、アルファベット、アンダースコア。
  • フィールド名の先頭に0-9または_を使用できません。
  • SplunkがDefaultで使用しているフィールド名は使えません。(_time,_indextime,hostなど)
  • 国際文字は使用できません。

ユーザ名

usernames stored in native authentication cannot contain spaces, colons, or forward slashes. Names are case-insensitive, for example: "Jacque", "jacque", "JacQue" are all the same to Splunk authentication.

Splunkのネイティブ認証を使う場合、ユーザ名は、スペース、コロン、またはスラッシュを使⽤することはできません。また、名前の⼤⽂字と⼩⽂字は区別されません。

ロール名

Role names must use lowercase characters only. They cannot contain spaces, colons, or forward slashes.

  • ロール名は小文字しか使用できません。
  • スペース、コロン、スラッシュを使用することはできません。

ダッシュボードID

  • GUIで作成する時のダイアログに「文字、数字、およびアンダースコアのみを使用できます。」と
    表示されるので、それが制約のようです。

パネル名

ID: The filename for the panel. Only alphanumeric characters, '-' character, and '_' are allowed.

  • パネルのファイル名は英数字、ハイフン、アンダースコアのみを使用できます。

ダッシュボードの各エレメントのID属性

Input identifier.
Only alphanumeric and underscore characters are valid. The id cannot begin with a number or the underscore character.

  • ID属性は英数字とアンダースコアのみ使用できます。
  • 数字またはアンダースコアからはじめることはできません。
  • 最低二文字必要です。

マクロ名

(Optional) Enter any Arguments for your search macro. This is a comma-delimited string of argument names. Argument names may only contain alphanumeric characters (a-Z, A-Z, 0-9), underscores, and dashes. The string cannot contain repetitions of argument names.

  • 引数名には英数字 (a-z、A-Z、0-9)、アンダースコア、およびダッシュしか使⽤できません。
  • 文字列には、引数名の繰り返しは含まれません。

アラート/レポート名

公式ドキュメントでの記載は特にみられませんでした。(2018/7/12時点)
※日本語で定義したことはあります。

カスタムアラートアクション名

The stanza name must be unique. Two apps cannot define the same alert action.
The stanza name can contain only the following characters.
・alphanumeric characters
・underscores
・hyphens
・The stanza name cannot contain spaces.

  • カスタムアラートのスタンザ名は英数字、アンダースコア、ハイフンのみ含めることができます。
  • スペースを含めることはできません。
  • ユニークである必要があります。

##データモデル
https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Managedatamodels

The Title field can accept any character except asterisks. It can also accept blank spaces between characters.
The data model ID field fills in as you enter the title. Do not update it. The data model ID must be a unique identifier for the data model. It can only contain letters, numbers, and underscores. Spaces between characters are also not allowed. After you click Create you cannot change the ID value.

  • タイトルはアスタリスク*を除いた任意の文字を使用できます。また文字間にスペースを入れることができます。
  • データモデルIDは文字、数字、アンダースコアのみ使用できます。スペースは入れられません。

ルックアップの制約について

命名に関する内容ではないのですが、制限についてドキュメントに記述されていたのでメモしておきます。

The CSV file cannot contain non-utf-8 characters. Plain ascii text is supported, as is any character set that is also valid utf-8.

  • CSVファイルの文字は、平易なASCIIテキストと有効なUTF-8文字でなければなりません。非UTF-8文字はサポートされていません。

The following are unsupported:
CSV files with pre-OS X (OS 9 or earlier) Macintosh-style line endings (carriage return ("\r") only)
CSV files with header rows that exceed 4096 characters.

  • CSVファイルは "\ r"行の末尾にすることはできません(OSX 9以前)
  • CSVファイルには4096文字を超えるヘッダー行を含めることはできません。
4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1