summaryrefslogtreecommitdiffstats
path: root/src/formats/page_log.json
blob: 0758b1320cb472ead8a2f73c0f563b1cc7ed7fcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
    "$schema": "https://lnav.org/schemas/format-v1.schema.json",
    "page_log": {
        "title": "CUPS Page Log",
        "description": "The CUPS server log of printed pages.",
        "url": "http://www.cups.org/documentation.php/doc-1.7/ref-page_log.html",
        "multiline": false,
        "regex": {
            "pre-1.7": {
                "pattern": "^(?<printer>[\\w_\\-\\.]+) (?<username>[\\w\\.\\-]+) (?<job_id>\\d+) \\[(?<timestamp>[^\\]]+)\\] (?<page_number>total|\\d+) (?<num_copies>\\d+) (?<job_billing>[^ ]+) (?<job_originating_hostname>[\\w\\.:\\-]+)$"
            },
            "1.7": {
                "pattern": "^(?<printer>[\\w_\\-\\.]+) (?<username>[\\w\\.\\-]+) (?<job_id>\\d+) \\[(?<timestamp>[^\\]]+)\\] (?<page_number>total|\\d+) (?<num_copies>\\d+) (?<job_billing>[^ ]+) (?<job_originating_hostname>[\\w\\.:\\-]+) (?<job_name>.+) (?<media>[^ ]+) (?<sides>.+)(?<body>.*)$"
            }
        },
        "value": {
            "printer": {
                "kind": "string",
                "identifier": true
            },
            "username": {
                "kind": "string",
                "identifier": true
            },
            "job_id": {
                "kind": "integer",
                "identifier": true,
                "foreign-key": true
            },
            "page_number": {
                "kind": "string"
            },
            "num_copies": {
                "kind": "integer"
            },
            "job_billing": {
                "kind": "string",
                "identifier": true
            },
            "job_originating_hostname": {
                "kind": "string",
                "collate": "ipaddress",
                "identifier": true
            },
            "job_name": {
                "kind": "string",
                "identifier": true
            },
            "media": {
                "kind": "string",
                "identifier": true
            },
            "sides": {
                "kind": "string",
                "identifier": true
            }
        },
        "sample": [
            {
                "line": "Photosmart_7520_series stack 11 [18/May/2013:13:21:15 -0700] total 0 - localhost 5615311548-159003235-tickets.pdf Letter one-sided"
            },
            {
                "line": "tec_IS2027 kurt 401 [22/Apr/2003:10:28:43 +0100] 1 3 #marketing 10.160.50.13"
            }
        ]
    }
}