]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/accesslog.js
1 /*! `accesslog` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
7 Language: Apache Access Log
8 Author: Oleg Efimov <efimovov@gmail.com>
9 Description: Apache/Nginx Access Logs
10 Website: https://httpd.apache.org/docs/2.4/logs.html#accesslog
15 /** @type LanguageFn */
16 function accesslog(hljs
) {
17 const regex
= hljs
.regex
;
18 // https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
31 name: 'Apache Access Log',
36 begin: /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?\b/,
48 begin: regex
.concat(/"/, regex.either(...HTTP_VERBS)),
55 begin: /HTTP\/[12]\.\d'/,
63 // dates must have a certain length, this prevents matching
64 // simple array accesses a[123] and [] and other common patterns
65 // found in other languages
66 begin: /\[\d[^\]\n]{8,}\]/,
77 // User agent / relevance boost
80 begin: /"Mozilla\/\d\.\d \(/,
101 hljs
.registerLanguage('accesslog', hljsGrammar
);