+ * $job = ...; + * while (!$job->refresh()->isDone()) { usleep(0.5 * 1000000); } + * + * foreach ($job->getResults() as $result) + * { + * // (See documentation for Splunk_ResultsReader to see how to + * // interpret $result.) + * ... + * } + *+ * + * This method cannot be used to access results from realtime jobs, + * which are never done. Use {@link getResultsPreviewPage()} instead. + * + * @param array $args (optional) {
+ * $job = ...; + * while (!$job->refresh()->isDone()) { usleep(0.5 * 1000000); } + * + * $results = new Splunk_ResultsReader($job->getResultsPage()); + * foreach ($results as $result) + * { + * // (See documentation for Splunk_ResultsReader to see how to + * // interpret $result.) + * ... + * } + *+ * + * This method cannot be used to access results from realtime jobs, + * which are never done. Use {@link getResultsPreviewPage()} instead. + * + * @param array $args (optional) {
提示: “GET”表示正常访问;“POST”表示从表单提交访问;“标黄”表示订单相关的访问。 | ||
'.htmlspecialchars($columnName). + ' | '; + echo '||
---|---|---|
';
+ if (is_array($cellValue))
+ {
+ $log = implode('', $cellValue);
+ //116.226.169.236 - - [27/Oct/2016:07:35:39 -0500] "GET / HTTP/1.1" 200 8857 "-" "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A456 Safari/602.1"
+ //ip(1), visit(3), from(6), ua(7)
+ $p = '/^(\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})\s-\s-\s\[(.*)\]\s\"(.*)\"\s(\d{3})\s(\d+)\s\"(.*)\"\s\"(.*)\"$/';
+ preg_match($p, $log, $matches);
+ //print_r($matches);
+ if (isset($matches[3]))
+ {
+ $tmp_a = explode(' ', $matches[3]);
+ echo 'visit '.urldecode($matches[3]).' ';
+ }
+ if (isset($matches[6]))
+ {
+ if ($matches[6]=='-') $matches[6] = '从收藏夹、历史记录或地址栏直接访问';
+ echo 'from '.urldecode($matches[6]).' ';
+ }
+ if (!isset($matches[1]))
+ {
+ echo $log;
+ }
+ }
+ echo ' | ';
+ }
+ //日期
+ else if ($columnName == '_time')
+ {
+ echo ''; + $time = strtotime($cellValue); + echo date('Y-m-d h:i:s', $time); + echo ' | '; + } + //splunk记录 + else + { + echo '';
+ if ($cellValue !== NULL)
+ {
+ if (is_array($cellValue))
+ {
+ echo '
| ';
+ }
+ }
+ echo '
+ 没有查到相关日志 +
+ + + + + \ No newline at end of file