Added access.log transformation batch for visidata

This commit is contained in:
TKE
2024-03-06 14:48:57 +00:00
parent 2ee7ed8c7d
commit bab6cd66f1

18
config/access_log.vdj Normal file
View File

@@ -0,0 +1,18 @@
#!vd -p
{"sheet": null, "col": null, "row": null, "longname": "open-file", "input": "examples/access_log", "keystrokes": "o", "comment": null}
{"sheet": "access_log", "col": "text", "row": "", "longname": "addcol-capture", "input": "^([\\d.]+)\\s+(\\S+)\\s+(\\S+)\\s\\[([^\\]]+)\\]\\s\"([^\"]+)\"\\s+(\\S+)\\s+(\\S+)\\s+\"([^\"]+)\"\\s+\"([^\"]+)\"", "keystrokes": ";", "comment": "Add column captured by regex"}
{"sheet": "access_log", "col": "text_re", "row": "", "longname": "expand-col", "input": "", "keystrokes": "(", "comment": "expand current column of containers one level"}
{"sheet": "access_log", "col": "text_re[0]", "row": "", "longname": "rename-col", "input": "ip", "keystrokes": "^", "comment": "rename current column"}
{"sheet": "access_log", "col": "text_re[3]", "row": "", "longname": "rename-col", "input": "time", "keystrokes": "^", "comment": "rename current column"}
{"sheet": "access_log", "col": "text_re[4]", "row": "", "longname": "addcol-split", "input": " ", "keystrokes": ":", "comment": "Add column split by regex"}
{"sheet": "access_log", "col": "text_re[4]", "row": "", "longname": "hide-col", "input": "", "keystrokes": "-", "comment": "hide the current column"}
{"sheet": "access_log", "col": "text_re[4]_re", "row": "", "longname": "expand-col", "input": "", "keystrokes": "(", "comment": "expand current column of containers one level"}
{"sheet": "access_log", "col": "text_re[4]_re[0]", "row": "", "longname": "rename-col", "input": "method", "keystrokes": "^", "comment": "rename current column"}
{"sheet": "access_log", "col": "text_re[4]_re[1]", "row": "", "longname": "rename-col", "input": "url", "keystrokes": "^", "comment": "rename current column"}
{"sheet": "access_log", "col": "text_re[4]_re[2]", "row": "", "longname": "rename-col", "input": "version", "keystrokes": "^", "comment": "rename current column"}
{"sheet": "access_log", "col": "text_re[5]", "row": "", "longname": "rename-col", "input": "status", "keystrokes": "^", "comment": "rename current column"}
{"sheet": "access_log", "col": "text_re[6]", "row": "", "longname": "rename-col", "input": "size", "keystrokes": "^", "comment": "rename current column"}
{"sheet": "access_log", "col": "size", "row": "", "longname": "type-int", "input": "", "keystrokes": "#", "comment": "set type of current column to int"}
{"sheet": "access_log", "col": "text_re[7]", "row": "", "longname": "rename-col", "input": "referrer", "keystrokes": "^", "comment": "rename current column"}
{"sheet": "access_log", "col": "text_re[8]", "row": "", "longname": "rename-col", "input": "useragent", "keystrokes": "^", "comment": "rename current column"}
{"sheet": "access_log", "col": "text", "row": "", "longname": "hide-col", "input": "", "keystrokes": "-", "comment": "hide the current column"}