1

我有一个来自 JMeter 的日志文件,其中包含以下列。

timeStamp ,elapsed ,label, responseCode, responseMessage,threadName,dataType,success,failureMessage,bytes,grpThreads,allThreads,Latency,SampleCount,ErrorCount,Hostname

我已经能够在 Kibana 上生成一个图表,它给了我经过的时间。

但我一直无法搜索延迟。

直方图设置中是否有任何地方可以选择要在时间戳和延迟或时间戳和错误计数之间绘制图表?

此外,我在 JMeter 中的时间戳定义为“jmeter.save.saveservice.timestamp_format=yyyy-MM-dd'T'HH:mm:ss.SSSZ”

但我在 ElasticSearch 中遇到错误

[2014-11-05 16:22:54,816][DEBUG][action.search.type       ] [Contrary] [shakespeare][2], node[S7Xyo1rSRGq6gzC9HtsCsg], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@453beee2] lastShard [true]
org.elasticsearch.search.SearchParseException: [shakespeare][2]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"facets":{"0":{"date_histogram":{"field":"@timestamp","interval":"1s"},"global":true,"facet_filter":{"fquery":{"query":{"filtered":{"query":{"query_string":{"query":"*"}},"filter":{"bool":{"must":[{"range":{"@timestamp":{"from":1415141574791,"to":1415184774791}}}]}}}}}}}},"size":20,"query":{"filtered":{"query":{"query_string":{"query":"Latency"}},"filter":{"bool":{"must":[{"range":{"@timestamp":{"from":1415141574791,"to":1415184774791}}}]}}}},"sort":[{"_score":{"order":"desc","ignore_unmapped":true}},{"@timestamp":{"order":"desc","ignore_unmapped":true}}]}]]

有什么办法可以解决这个错误吗?

谢谢,

4

1 回答 1

3

不会直接回答您的问题,但会提供我们将 jmeter 结果导入 logstash 的方式

JmeterLog 示例: timeStamp,elapsed,label,responseCode,responseMessage,threadName,bytes,grpThreads,allThreads,URL,Latency 2014-11-05 09:43:56,13742,1 Load Tweet Feed Content,200,OK,Thread Group 1 -964,4557,33,33, http://activity.flux.com/api/ActivityService/FindActivities2?cmId=12C6FFFF01DCE0D90002FFFFC612&cnId=12C6FFFF01DCE0D9001B01F459C3&dSCF=true&aFF=Twitter&mR=20&iT=true&iR=true&pAT=CommentContent&_t=1392986211131&skipCache=true&callback=FCA8AD20E&product=load_testing&productLocation =load_testing,13742

Logstash 解析过滤器

  #Load Test data
  if [LogSeverityType] == "LoadTest" {
    if [Message] =~ "^time" {drop {}}
    grok{
    match => ["Message","%{TIMESTAMP_ISO8601:log_timestamp},%{NUMBER:elapsed},%{DATA:label},%{NUMBER:responseCode},%{DATA:responseMessage},%{DATA:threadName},%{NUMBER:bytes},%{NUMBER:grpThreads},%{NUMBER:allThreads},%{DATA:URL},%{NUMBER:Latency}"]
    }
    mutate {
      convert => [ "Latency", "integer" ]
      convert => [ "elapsed", "integer" ]
      convert => [ "grpThreads", "integer" ]
      convert => [ "allThreads", "integer" ]
      convert => [ "responseCode", "integer" ]
      convert => [ "bytes", "integer" ]
    }
    date {
      match => [ "log_timestamp", "YYYY-MM-dd HH:mm:ss", "ISO8601" ]
      timezone => "Etc/UCT"
    }
  }
于 2014-11-05T11:59:30.860 回答