このトピックでは、指定された複数属性フィールドサンプルから属性の代表的な組み合わせをマイニングして現在のログを要約するために使用できる頻出パターン統計関数について説明します。

pattern_stat

関数の形式:
select pattern_stat( array[col1, col2, col3], array['col1_name', 'col2_name', 'col3_name'], array[col5, col6], array['col5_name', 'col6_name'], support_score, _sample ratio) 
次の表に、関数のパラメーターを示します。
パラメーター 説明
配列 [col1, col2, col3] 文字型の値の入力列。 値は配列形式です。 例: array[clientIP, sourceIP, path, logstore] 。
array['col1_name', 'col2_name', 'col3_name'] 文字型値の入力列に対応する名前。 値は配列形式です。 例: array['clientIP', 'sourceIP', 'path', 'logstore'] 。
配列 [col5, col6] 数値の入力列。 値は配列形式です。 例: array[Inflow, OutFlow] 。
配列 ['col5_name', 'col6_name'] 数値の入力列に対応する名前。 値は配列形式です。 例: array['Inflow', 'OutFlow']
support_score パターンマイニングにおけるサンプルのサポートレベル。 値はdoubleデータ型です。 有効な値: (0,1) 。
sample_ratio サンプリング比。 デフォルト値は0.1です。これは、合計サンプルの10% のみが使用されることを示します。 値はdoubleデータ型です。 有効な値: (0,1) 。
  • クエリステートメントは次のとおりです。
    * | select pattern_stat(array[ Category, ClientIP, ProjectName, LogStore, Method, Source, UserAgent ], array[ 'Category', 'ClientIP', 'ProjectName', 'LogStore', 'Method', 'Source', 'UserAgent' ], array[ InFlow, OutFlow ], array[ 'InFlow', 'OutFlow' ], 0.45, 0.3) limit 1000
  • 出力結果

表示项目一覧を次の表に示します。
表示項目 説明
集計 現在のパターンに適合するサンプルの数。
support_score 現在のパターンのサポートレベル。
pattern 現在のパターンの内容。条件付きクエリの形式で構成されています。