2017-02-13 1 views
0

私はcsvで持っているパフォーマンスのナビゲーションタイミングデータの解析と計算に問題があります。Logstashの解析とCSVによる計算

私はフィールドを解析することができましたが、計算(下記)に正しくアプローチする方法が不明でした。心に留めておくべきいくつかのポイント:

データセットはunloadEventEndが、それは21個のデータポイントが ACMEPage-1486643427973を取られたときのTSである(太字値によってグループ化され、1486643372422 2.Calculationsは、データに行われる必要がありますグループ内のポイント タグ付けやグループ化が必要であると仮定していますが、実装方法について明確なビジョンはありません。

おかげで、

---------------計算-----------------

  • 総ファーストバイト時間= responseStart - navigationStart
  • レイテンシ= responseStart - fetchStart
  • DNS /ドメイン検索時間= domainLookupEnd - domainLookupStart
  • サーバー接続時間= connectEnd - connectStart
  • サーバー応答時間= responseStart - requestStart
  • ページの読み込み時間= loadEventStart - navigationStart
  • 転送/ページのダウンロード時間= responseEnd - responseStart
  • DOMインタラクティブ時間= domInteractive - navigationStart
  • DOMコンテンツロード時間= domContentLoadedEventEnd - navigationStart
  • 対話型DOM処理= domInteractive - domLoading
  • 対話を完了するためのDOM = domComplete - domInteractive
  • ロード時= loadEventEnd - loadEventStart

------- CSVのデータ-----------

ACMEPage-1486643427973、unloadEventEnd、1486643372422 ACMEPage-1486643427973、responseEnd、1486643372533 ACMEPage-1486643427973、responseStart、1486643372416 ACMEPage-1486643427973、domInteractive、1486643373030 ACMEPage-1486643427973、domainLookupEnd、1486643372194 ACMEPage-1486643427973、アンロードEventStart、1486643372422 ACMEPage-1486643427973、domComplete、1486643373512 ACMEPage-1486643427973、domContentLoadedEventStart、1486643373030 ACMEPage-1486643427973、domainLookupStart、1486643372194 ACMEPage-1486643427973、redirectEnd、0 ACMEPage-1486643427973、redirectStart、0 ACMEPage-1486643427973、connectEnd、 1486643372194 ACMEPage-1486643427973、toJSON、{} ACMEPage-1486643427973、connectStart、1486643372194 ACMEPage-1486643427973、loadEventStart、1486643373512 ACMEPage-1486643427973、navigationStart、1486643372193 ACMEPage-1486643427973、requestStart、1486643372203 ACMEPage-1486643427973、secureConnectionStart、0 ACMEPage-1486643427973、fetchStart、1486643372194 ACMEPage-1486643427973、domContentLoadedEventEnd、1486643373058 ACMEPage-1486643427973、domLoading、1486643372433 ACMEPage-1486643427973、loadEventEnd、1486643373514

----------出力 - --------------

"path" => "/Users/philipp/Downloads/build2/logDataPoints_com.concur.automation.cge.ui.admin.ADCLookup_1486643340910.csv", 
"@timestamp" => 2017-02-09T12:29:57.763Z, 
"navigationTimer" => "connectStart", 
"@version" => "1", 
"host" => "15mbp-09796.local", 
"elapsed_time" => "1486643372194", 
"pid" => "1486643397763", 
"page" => "ADCLookupDataPage", 
"message" => "ADCLookupDataPage-1486643397763,connectStart,1486643372194", 
"type" => "csv" 
} 

-------------- logstashconfに----------------私は私のデータをトレンド取得するには、次の

input { 
file { 
type => "csv" 
path => "/Users/path/logDataPoints_com.concur.automation.acme.ui.admin.acme_1486643340910.csv" 
start_position => beginning 
# to read from the beginning of file 
sincedb_path => "/dev/null" 
} 
} 

filter { 
csv { 
columns => ["page_id", "navigationTimer", "elapsed_time"] 
} 

if (["elapsed_time"] == "{}") { 
drop{} 
} 
else { 
grok { 
match => { "page_id" => "%{WORD:page}-%{INT:pid}" 
} 

remove_field => [ "page_id" ] 
} 
} 

date { 
match => [ "pid", "UNIX_MS" ] 
target => "@timestamp" 
} 
} 

output { 
elasticsearch { hosts => ["localhost:9200"] } 
stdout { codec => rubydebug } 
} 

答えて

0

-Iは、簡単にデータをピボットではなく、行くことが見いださ列の下、データはそれぞれ「イベント」や「文書」あたりの行に沿って行く持っている

データがでた

  • たら、整数や文字列などに応じてマッピングすることが必要

    - 各フィールド木場を正しく使うには問題がありましたyコードフィルタを使用して簡単な数式の計算を行うので、「スクリプトフィールド」を使用して木場の計算を終了しました。

    input { 
        file { 
         type => "csv" 
        path => "/Users/philipp/perf_csv_pivot2.csv" 
        start_position => beginning 
        # to read from the beginning of file 
        sincedb_path => "/dev/null" 
        } 
    } 
    
    
    filter { 
        csv { 
         columns => ["page_id","unloadEventEnd","responseEnd","responseStart","domInteractive","domainLookupEnd","unloadEventStart","domComplete","domContentLoadedEventStart","domainLookupstart","redirectEnd","redirectStart","connectEnd","toJSON","connectStart","loadEventStart","navigationStart","requestStart","secureConnectionStart","fetchStart","domContentLoadedEventEnd","domLoading","loadEventEnd"] 
        } 
    

    GROK { マッチ=> { "page_idの" => "%{WORD:ページ} - %{INT:page_ts}"} remove_field => "page_idの"、 "メッセージ"、「パス"]}

    mutate { 
        convert => { "unloadEventEnd" => "integer" } 
        convert => { "responseEnd" => "integer" } 
        convert => { "responseStart" => "integer" } 
        convert => { "domInteractive" => "integer" } 
        convert => { "domainLookupEnd" => "integer" } 
        convert => { "unloadEventStart" => "integer" } 
        convert => { "domComplete" => "integer" } 
        convert => { "domContentLoadedEventStart" => "integer" } 
        convert => { "domainLookupstart" => "integer" } 
        convert => { "redirectEnd" => "integer" } 
        convert => { "redirectStart" => "integer" } 
        convert => { "connectEnd" => "integer" } 
        convert => { "toJSON" => "string" } 
        convert => { "connectStart" => "integer" } 
        convert => { "loadEventStart" => "integer" } 
        convert => { "navigationStart" => "integer" } 
        convert => { "requestStart" => "integer" } 
        convert => { "secureConnectionStart" => "integer" } 
        convert => { "fetchStart" => "integer" } 
        convert => { "domContentLoadedEventEnd" => "integer" } 
        convert => { "domLoading" => "integer" } 
        convert => { "loadEventEnd" => "integer" } 
    
        } 
    
    
        date { 
         match => [ "page_ts", "UNIX_MS" ] 
         target => "@timestamp" 
         remove_field => [ "page_ts", "timestamp", "host", "toJSON" ] 
         } 
        } 
    output { 
        elasticsearch { hosts => ["localhost:9200"] } 
        stdout { codec => rubydebug } 
        } 
    

これは他の誰かを助けることを願って、

関連する問題