Kibana3+Elasticsearchã触ã£ã¦ã¿ã話
æè¿Elasticsearchã触ã£ã¦ããã話ã§ããï¼ã¨ãã£ã¦ãã¾ã 1é±éããããï¼
ç»åä¸æ¯ã§éãã§ã注æã»ã»ã»
å
ã
GrowthForecastã§ã¢ã¯ã»ã¹ãã°ãè¦ããããã«ãã¦ãã¾ããã
ï¼ã¾ããããå²ã¨æè¿ãã£ããã§ãããããï¼
ä¾ãã°コチラãåèã«ã
ã¨ã表示ãã¦ã¾ãããï¼ã¾ãã¾ã§ããï¼
GrowthForecastã¯æ°è»½ã«ç°¡åã«ã°ã©ãåã§ãã¦ã¦ã©ããããããã®ã§å©ããã®ã§ããã
ã¢ã¯ã»ã¹å
容ããããå°ãæãä¸ãããè¦ä»¶ãªãããåºã¦ãã¾ããã
æãããElasticsearchåå¼·ä¼ãã¿ã¤ãã³ã°ãéãªããé常ã«æã£ãã®ã§é å¼µã£ã¦æ¸ãã¦ã¿ã¾ãã
Elasticsearchãç´¹ä»ããè¨äºã¯å¢ãã¦ããã®ã§ãããã¤ã³ã¹ãã¼ã«ç³»ãå¤ãæ°ãããã®ã§
ä»åã¯ã¾ãã¯Kibana3ã®è¦ãç®ã¨ä½¿ãæ¹ããå
¥ã£ã¦ã¿ããã¨æãã¾ãã
ã¤ã³ã¹ãã¼ã«ãmappingãªãããæ¸ãã§ãã¼ã¿ãå ¥ã£ã¦ããã®ã¨ãã¾ãã
ãã¦ãhttp://(address)/kibana/ãã¿ãããªã¢ãã¬ã¹ã§ã¢ã¯ã»ã¹ããã¨ããã¹ãä¸æ¯ã®ç»é¢ã
ã¾ã表示ãããã®ã§ããããã®ç»é¢ã®å³å´çãä¸ãã¸ãã«Logstashã¨æ¸ããããªã³ã¯ãããã®ã§
ã¯ãªãã¯ããã¨è¡¨ç¤ºãããã®ã次ã®ç»é¢ã§ãã
å®éã«ã¯ã¡ãã£ã¨ã ãè¨å®ãããã®ã§ããä»åã¯å²æã
ãã®ç¸¦é·ã®å
¨é¨ã§åæããã·ã¥ãã¼ãã«ãªãã¾ãã
1段ç®ï¼æéç¯å²æå®ï¼åæ表示ã¯Relativeã ãã©ãããã§ã¯Absoluteã«å¤æ´ï¼
2段ç®ï¼Queryãæ¸ãããã£ã¼ã«ã
3段ç®ï¼ãã¹ãã°ã©ã
4段ç®ï¼Table
ã«ãªã£ã¦ã¾ãã
ãããã¯é£åãã¦ãã¦ãæéã®ç¯å²ãçµããQueryãæ¸ãã¨
ãã¹ãã°ã©ã ãTableããã®ç¯å²å
ã表示ããããã«ãªã£ã¦ãã¾ãã
ã«ã¬ã³ãã¼ããã®æ¥ä»é¸æã§ããã¡ããè¯ãã®ã§ããã
ä¾ãã°è¦ãã¦ããç¯å²ã®ä¸é¨ããã¦ã¹ã§ãã©ãã°ããã¨ã
ãã®é¨åãæ¡å¤§ããã¾ãã
ãã¹ãã°ã©ã ã«ãããã¤ã表示ãããã®ã§ããä»åã®ãã¼ã¿ã¤ãã®å ´åã
ã«ã¼ã½ã«ãåãããã¨ãã®é¨åã®ã«ã¦ã³ãã表示ããã¾ãã
ç»é¢ã®å·¦ä¸ã®Zoom Outã®é£ã®å¡ä¾ã«ã¯ç»é¢å
ã®ç·ã«ã¦ã³ãã表示ããã¾ãã
åæ¡ä»¶ããã¤ã¾ããªãã®ã§Queryãæ¸ãã¦ã¿ã¾ãã
ã¢ã¯ã»ã¹ãã°ã®ã¹ãã¼ã¿ã¹ã³ã¼ããããã¼ãcodeããå¤ã200ãï¼Stringï¼ã¿ããã«ç»é²ãã¦ããã®ã§ã
ãcode:200ãã¨ãæ¸ãã¨æ¤ç´¢ãã¦ããã¾ãã
æ£ã°ã©ãã®å ´åãè¤æ°æ¡ä»¶æ¸ãã¨ããã©ã«ãã¯ç©ã¿ä¸ãã«ãã¦ããã¾ãã
ä»ã®è¡¨ç¤ºæ¹æ³ãããããããã¯ãã ãã©ä»ã®ã¨ããããã§æºè¶³ãã¦ããã
Queryãæ¸ããã£ã¼ã«ãã¯ãã¦ã¹ãªã¼ãã¼ããã¨Ãã¨ãï¼ã¨ãåºãã®ã§åé¤ããã追å ãããåºæ¥ã¾ãã
ã¹ãã¼ã¿ã¹ã³ã¼ãã¯ããªã¨ã¼ã·ã§ã³ãã¤ãã¤ãã ã£ãã®ã§ã
ã¬ã¹ãã³ã¹ã¿ã¤ã ãæ¤ç´¢ãã¦ã¿ã¾ãã
ã ãã¶ã«ã©ãã«ã§ããã£ã½ããªãã¾ãããï¼
ãã¼ãresponse_timeãã§å¤ã¯Integerã§ç»é²ãã¦ãããã¼ã¿ã§ããåä½ã¯ãã¤ã¯ãç§ã§ãã
ãresponse_time:[0 TO 100000]ãã§ç¯å²æå®ã§ãã
Queryã®å
容ãç
©éã«ãªã£ã¦ããã®ã§å¡ä¾ã«ååãä»ãã¾ããã
å¡ä¾ã«ååãä»ãããè²ãå¤ãããå ´åã¯Queryãã£ã¼ã«ãã®âã®é¨åãã¯ãªãã¯ãã¦ç·¨éã§ãã¾ãã
ãã®æ¤ç´¢Queryãæ¸ãã®ã«ã¯æ°æ¥æ©ã¿ã¾ããã
Elasticsearchã®Queryãåç
§ãã¦
ã"range" : { "response_time" : { "from" : "0", "to" : "100000" } }ã
ã¿ãããªã®ãé å¼µã£ã¦çªã£è¾¼ãã ããã¦ããã§ããã
å®ã¯ã³ã³ã¯lucene syntaxã§æ¸ããã®ã§ãããæ¥ããããã
æ£ã°ã©ãã§ç©ã¿ä¸ããå ´åããã¦ã¹ãªã¼ãã¼ã§è¡¨ç¤ºãããã«ã¦ã³ããåè¨ããã¦ãã¾ã注æã
ãã®å ´åãç·502ï¼é38ï¼540ã¨ãããã¨ã§ããã
ãã¨çµæãéè¤ãããããªQueryãç©ã¿ä¸ããå ´åã
å½ç¶ãç·ã«ã¦ã³ããã大ãããªãã®ã§ãã®è¾ºã¯æ³¨æãã¦ãã ããã
Tableã¯ããã£ã¨ãã説æãã¾ãããå·¦ã®ãã§ãã¯ãå
¥ããé
ç®ã表示ããã対象ã«ãªãã
ååã®ã¨ãããã¯ãªãã¯ããã¨æé ãéé ã§æ´åããªããã¦ããã¾ãã
ãã®å ´åãresponse_timeãæé ã§æ´åãããã¨ããã§ãã
13ç§ãä½ãããã£ã¦ãããã§ããããã»ã»ã»
ãã¨ä»å使ã£ã¦ããæå»ã¯Apacheããã©ã«ãã®ãã¤ã§ã03/Sep/2013:07:51:08 +0000ã
ã¨ããªã£ã¦ããã®ã§mappingã§date_formatãè¨å®ãã¦ããå¿
è¦ãããã¾ãã
ãã®ãããã次回ã
ãã£ããæ¡ä»¶å
¥ãã¦ããæãã«ãªã£ãããã·ã¥ãã¼ãã§ããã
ãã®ã¾ã¾ã ã¨æ¬¡å表示æã«ã¯ã¾ãå
ã«æ»ã£ã¦ãã¾ãã¾ãã
ä¿åãã¦ããã«ã¯å³ä¸ã«ããã·ã¥ãã¼ãã³ã³ããã¼ã«ãããã¾ãã
ããã¯ä¿åç¨ãéããã¨ããããã¡ã¤ã«ã«JSONã§ä¿åãããã
ä¸ã®Titleã£ã¦ããã¨ããã«ååãå
¥ãã¦ä¿åããã¨Elasticsearchå
é¨ã«ä¿åããã¾ãã
ãã®ããã·ã¥ãã¼ãã³ã³ããã¼ã«ã以åã¯æ¥ä»æå®ã®å³å´ã«æµ®ãã¦ããã§ããã
ã¤ãæè¿ãä¸é¨ã«çµ±åããã¦å°ãã¹ã¿ã¤ãªãã·ã¥ã«ãªãã¾ãããã
ãã¡ãã¯ãã¼ãããæ¹ã§ããElasticsearchå
ã«ä¿åããå ´åã
ä¸çªä¸ã®æã«ä¸è¦§ã§è¡¨ç¤ºããã¾ããtest-1ã£ã¦ããã®ãããã§ãã
ããã¯3ã¤ç®ã®ãã¤ã§ä»äººã«ç»é¢ãShareããããã®URLã®ããã§ããã
ã¨ãããããããªæãã§ãã
ä»ã«ãåã°ã©ãããä¸çå°å³ãããCreate Rowã§æ®µãå¢ããããã
ã¾ãè²ã
ãããã¿ãããªãã§ãã使ãããªãã¦ãªãã®ã§ãã®ãããã
ã«ã¸ã¥ã¢ã«ã«ãã°è§£æãªç¨éã§ã¯ããã§ãçµæ§ä½¿ããã®ã§ã¯ãªãã§ããããã
æ¤ç´¢æ¡ä»¶ãè¤åçãªãã®ãæ¤ç´¢ã§ããã¯ããªã®ã§ã
ãã®è¾ºã¯ä½è£ããã£ãã試ãã¦ããããã§ãã