Skip to content

Logs

Web server access logs: each request with its client, time in ISO 8601, method, path and query apart, protocol, status with its class, size, referrer and user agent; a dash leaves the value out.

input.txtHover a value to see its type · click it to find it in the treeRun in Studio
192.0.2.1 - - [17/May/2015:10:05:03 +0000] "GET /presentations/logstash-monitorama-2013/images/kibana-search.png HTTP/1.1" 200 203023 "http://semicomplete.com/presentations/logstash-monitorama-2013/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
192.0.2.2 - - [17/May/2015:10:05:22 +0000] "GET /doc/index.html?org/elasticsearch/action/search/SearchResponse.html HTTP/1.1" 404 294 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
192.0.2.3 - - [17/May/2015:11:05:17 +0000] "GET /projects/xdotool/xdotool.xhtml HTTP/1.1" 304 - "-" "Sogou web spider/4.0(+http://www.sogou.com/docs/help/webmasters.htm#07)"
192.0.2.4 - - [17/May/2015:11:05:47 +0000] "GET /projects/xdotool HTTP/1.1" 301 339 "http://tuxradar.com/content/xdotool-script-your-mouse" "Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0"
192.0.2.5 - - [17/May/2015:14:05:30 +0000] "GET /presentations/logstash-puppetconf-2012/images/apache-negative-duration.png HTTP/1.1" 206 97173 "-" "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)"
192.0.2.6 - - [17/May/2015:16:05:27 +0000] "HEAD /projects/xdotool/ HTTP/1.1" 200 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0"
192.0.2.7 - - [18/May/2015:03:05:34 +0000] "GET /misc/Title.php.txt HTTP/1.1" 500 - "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
192.0.2.8 - - [18/May/2015:11:05:47 +0000] "GET /presentations/vim/+++++++++++++++++++++++++++++++++++Result:+%E8%F1%EF%EE%EB%FC%E7%EE%E2%E0%ED+%ED%E8%EA%ED%E5%E9%EC+%22newkoversjup%22;+ReCaptcha+%E4%E5%F8%E8%F4%F0%EE%E2%E0%ED%E0;+%28JS%29;+%E7%E0%F0%E5%E3%E8%F1%F2%F0%E8%F0%EE%E2%E0%EB%E8%F1%FC;+%ED%E5+%ED%E0%F8%EB%EE%F1%FC+%F4%EE%F0%EC%FB+%E4%EB%FF+%EE%F2%EF%F0%E0%E2%EA%E8;+Result:+%EE%F8%E8%E1%EA%E0:+%22i+never+really+liked+c%27s+assert%28%29+feature.+if+an+assertion+is+violated,+it%27lltell+you+what+assertion+failed+but+completely+lacks+any+context:%22;+%ED%E5+%ED%E0%F8%EB%EE%F1%FC+%F4%EE%F0%EC%FB+%E4%EB%FF+%EE%F2%EF%F0%E0%E2%EA%E8; HTTP/1.0" 403 676 "http://www.semicomplete.com/presentations/vim/+++++++++++++++++++++++++++++++++++Result:+%E8%F1%EF%EE%EB%FC%E7%EE%E2%E0%ED+%ED%E8%EA%ED%E5%E9%EC+%22newkoversjup%22;+ReCaptcha+%E4%E5%F8%E8%F4%F0%EE%E2%E0%ED%E0;+%28JS%29;+%E7%E0%F0%E5%E3%E8%F1%F2%F0%E8%F0%EE%E2%E0%EB%E8%F1%FC;+%ED%E5+%ED%E0%F8%EB%EE%F1%FC+%F4%EE%F0%EC%FB+%E4%EB%FF+%EE%F2%EF%F0%E0%E2%EA%E8;+Result:+%EE%F8%E8%E1%EA%E0:+%22i+never+really+liked+c%27s+assert%28%29+feature.+if+an+assertion+is+violated,+it%27lltell+you+what+assertion+failed+but+completely+lacks+any+context:%22;+%ED%E5+%ED%E0%F8%EB%EE%F1%FC+%F4%EE%F0%EC%FB+%E4%EB%FF+%EE%F2%EF%F0%E0%E2%EA%E8;" "Opera/9.80 (Windows NT 6.1; WOW64; U; ru) Presto/2.10.289 Version/12.01"
192.0.2.9 - - [19/May/2015:04:05:16 +0000] "POST /blog/geekery/xvfb-firefox HTTP/1.0" 200 10975 "http://zoomq.qiniudn.com/ZQScrapBook/ZqFLOSS/data/20110811235550/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.91 Safari/537.11"
192.0.2.10 - - [19/May/2015:06:05:17 +0000] "GET /files/xdotool/xdotool-2.20101014.3063.tar.gz HTTP/1.1" 416 400 "-" "Wget/1.14 (linux-gnu)"
192.0.2.11 - - [20/May/2015:14:05:16 +0000] "OPTIONS /projects/xdotool/ HTTP/1.1" 500 626 "-" "Microsoft Office Protocol Discovery"
logs.ymlspec
Timestamp:
  $local:
    Day: '\d{2}'
    Year: '\d{4}'
    Clock: '\d{2}'
    Sign: '[+-]'

    Month:
      January: { $patterns: 'Jan', $value: '01' }
      February: { $patterns: 'Feb', $value: '02' }
      March: { $patterns: 'Mar', $value: '03' }
      April: { $patterns: 'Apr', $value: '04' }
      May: { $patterns: 'May', $value: '05' }
      June: { $patterns: 'Jun', $value: '06' }
      July: { $patterns: 'Jul', $value: '07' }
      August: { $patterns: 'Aug', $value: '08' }
      September: { $patterns: 'Sep', $value: '09' }
      October: { $patterns: 'Oct', $value: '10' }
      November: { $patterns: 'Nov', $value: '11' }
      December: { $patterns: 'Dec', $value: '12' }

  $fields:
    day: Day
    month: Month
    year: Year
    hour: Clock
    minute: Clock
    second: Clock
    sign: Sign
    offset_hours: Clock
    offset_minutes: Clock
  $patterns: '\[#{day}/#{month}/#{year}:#{hour}:#{minute}:#{second} #{sign}#{offset_hours}#{offset_minutes}\]'
  $value: '#{year}-#{month}-#{day}T#{hour}:#{minute}:#{second}#{sign}#{offset_hours}:#{offset_minutes}'

Request:
  $local:
    Method: '[A-Z]+'
    Path: '[^\s?"]+'
    Query: '[^\s"]+'
    Protocol: 'HTTP/\d+(\.\d+)?'
  $fields: { method: Method, path: Path, query: Query, protocol: Protocol }
  $patterns: '#{method} #{path}(\?(#{query})?)? #{protocol}'

Entry:
  $flags: [ MULTILINE ]
  $local:
    Address: '[0-9A-Za-z.:-]+'
    Size: '\d+'
    Quoted: '([^"\\]|\\.)+'
    RawRequest: '([^"\\]|\\.)*'

    Status:
      $local: { Code: '\d{3}' }
      $fields: { code: Code }
      $patterns: '#{code}'
      $value: { code: '#{code}' }

      Informational:
        $local: { Code: '1\d\d' }
        $value: { code: '#{code}', class: 'informational' }

      Success:
        $local: { Code: '2\d\d' }
        $value: { code: '#{code}', class: 'success' }

      Redirect:
        $local: { Code: '3\d\d' }
        $value: { code: '#{code}', class: 'redirect' }

      ClientError:
        $local: { Code: '4\d\d' }
        $value: { code: '#{code}', class: 'client error' }

      ServerError:
        $local: { Code: '5\d\d' }
        $value: { code: '#{code}', class: 'server error' }

  $fields:
    client: Address
    time: Timestamp
    request: Request
    status: Status
    size: Size
    referrer: Quoted
    agent: Quoted
  $patterns: '^#{client} \S+ \S+ #{time} "(#{request}|${RawRequest})" #{status} (#{size}|-)( "(-|#{referrer})" "(-|#{agent})")?'
$ texomy parse input.txt -m logs
logs.json
[
  {
    "type": "Entry",
    "start": 0,
    "end": 321,
    "fields": {
      "client": {
        "type": "Address",
        "start": 0,
        "end": 9,
        "text": "192.0.2.1"
      },
      "time": {
        "type": "Timestamp",
        "start": 14,
        "end": 42,
        "fields": {
          "day": {
            "type": "Day",
            "start": 15,
            "end": 17,
            "text": "17"
          },
          "month": {
            "type": "Month::May",
            "start": 18,
            "end": 21,
            "text": "May",
            "value": "05"
          },
          "year": {
            "type": "Year",
            "start": 22,
            "end": 26,
            "text": "2015"
          },
          "hour": {
            "type": "Clock",
            "start": 27,
            "end": 29,
            "text": "10"
          },
          "minute": {
            "type": "Clock",
            "start": 30,
            "end": 32,
            "text": "05"
          },
          "second": {
            "type": "Clock",
            "start": 33,
            "end": 35,
            "text": "03"
          },
          "sign": {
            "type": "Sign",
            "start": 36,
            "end": 37,
            "text": "+"
          },
          "offset_hours": {
            "type": "Clock",
            "start": 37,
            "end": 39,
            "text": "00"
          },
          "offset_minutes": {
            "type": "Clock",
            "start": 39,
            "end": 41,
            "text": "00"
          }
        },
        "value": "2015-05-17T10:05:03+00:00"
      },
      "request": {
        "type": "Request",
        "start": 44,
        "end": 121,
        "fields": {
          "method": {
            "type": "Method",
            "start": 44,
            "end": 47,
            "text": "GET"
          },
          "path": {
            "type": "Path",
            "start": 48,
            "end": 112,
            "text": "/presentations/logstash-monitorama-2013/images/kibana-search.png"
          },
          "protocol": {
            "type": "Protocol",
            "start": 113,
            "end": 121,
            "text": "HTTP/1.1"
          }
        }
      },
      "status": {
        "type": "Status::Success",
        "start": 123,
        "end": 126,
        "fields": {
          "code": {
            "type": "Code",
            "start": 123,
            "end": 126,
            "text": "200"
          }
        },
        "value": {
          "code": "200",
          "class": "success"
        }
      },
      "size": {
        "type": "Size",
        "start": 127,
        "end": 133,
        "text": "203023"
      },
      "referrer": {
        "type": "Quoted",
        "start": 135,
        "end": 198,
        "text": "http://semicomplete.com/presentations/logstash-monitorama-2013/"
      },
      "agent": {
        "type": "Quoted",
        "start": 201,
        "end": 320,
        "text": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
      }
    }
  },
  {
    "type": "Entry",
    "start": 322,
    "end": 534,
    "fields": {
      "client": {
        "type": "Address",
        "start": 322,
        "end": 331,
        "text": "192.0.2.2"
      },
      "time": {
        "type": "Timestamp",
        "start": 336,
        "end": 364,
        "fields": {
          "day": {
            "type": "Day",
            "start": 337,
            "end": 339,
            "text": "17"
          },
          "month": {
            "type": "Month::May",
            "start": 340,
            "end": 343,
            "text": "May",
            "value": "05"
          },
          "year": {
            "type": "Year",
            "start": 344,
            "end": 348,
            "text": "2015"
          },
          "hour": {
            "type": "Clock",
            "start": 349,
            "end": 351,
            "text": "10"
          },
          "minute": {
            "type": "Clock",
            "start": 352,
            "end": 354,
            "text": "05"
          },
          "second": {
            "type": "Clock",
            "start": 355,
            "end": 357,
            "text": "22"
          },
          "sign": {
            "type": "Sign",
            "start": 358,
            "end": 359,
            "text": "+"
          },
          "offset_hours": {
            "type": "Clock",
            "start": 359,
            "end": 361,
            "text": "00"
          },
          "offset_minutes": {
            "type": "Clock",
            "start": 361,
            "end": 363,
            "text": "00"
          }
        },
        "value": "2015-05-17T10:05:22+00:00"
      },
      "request": {
        "type": "Request",
        "start": 366,
        "end": 446,
        "fields": {
          "method": {
            "type": "Method",
            "start": 366,
            "end": 369,
            "text": "GET"
          },
          "path": {
            "type": "Path",
            "start": 370,
            "end": 385,
            "text": "/doc/index.html"
          },
          "query": {
            "type": "Query",
            "start": 386,
            "end": 437,
            "text": "org/elasticsearch/action/search/SearchResponse.html"
          },
          "protocol": {
            "type": "Protocol",
            "start": 438,
            "end": 446,
            "text": "HTTP/1.1"
          }
        }
      },
      "status": {
        "type": "Status::ClientError",
        "start": 448,
        "end": 451,
        "fields": {
          "code": {
            "type": "Code",
            "start": 448,
            "end": 451,
            "text": "404"
          }
        },
        "value": {
          "code": "404",
          "class": "client error"
        }
      },
      "size": {
        "type": "Size",
        "start": 452,
        "end": 455,
        "text": "294"
      },
      "agent": {
        "type": "Quoted",
        "start": 461,
        "end": 533,
        "text": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
      }
    }
  },
  {
    "type": "Entry",
    "start": 535,
    "end": 708,
    "fields": {
      "client": {
        "type": "Address",
        "start": 535,
        "end": 544,
        "text": "192.0.2.3"
      },
      "time": {
        "type": "Timestamp",
        "start": 549,
        "end": 577,
        "fields": {
          "day": {
            "type": "Day",
            "start": 550,
            "end": 552,
            "text": "17"
          },
          "month": {
            "type": "Month::May",
            "start": 553,
            "end": 556,
            "text": "May",
            "value": "05"
          },
          "year": {
            "type": "Year",
            "start": 557,
            "end": 561,
            "text": "2015"
          },
          "hour": {
            "type": "Clock",
            "start": 562,
            "end": 564,
            "text": "11"
          },
          "minute": {
            "type": "Clock",
            "start": 565,
            "end": 567,
            "text": "05"
          },
          "second": {
            "type": "Clock",
            "start": 568,
            "end": 570,
            "text": "17"
          },
          "sign": {
            "type": "Sign",
            "start": 571,
            "end": 572,
            "text": "+"
          },
          "offset_hours": {
            "type": "Clock",
            "start": 572,
            "end": 574,
            "text": "00"
          },
          "offset_minutes": {
            "type": "Clock",
            "start": 574,
            "end": 576,
            "text": "00"
          }
        },
        "value": "2015-05-17T11:05:17+00:00"
      },
      "request": {
        "type": "Request",
        "start": 579,
        "end": 623,
        "fields": {
          "method": {
            "type": "Method",
            "start": 579,
            "end": 582,
            "text": "GET"
          },
          "path": {
            "type": "Path",
            "start": 583,
            "end": 614,
            "text": "/projects/xdotool/xdotool.xhtml"
          },
          "protocol": {
            "type": "Protocol",
            "start": 615,
            "end": 623,
            "text": "HTTP/1.1"
          }
        }
      },
      "status": {
        "type": "Status::Redirect",
        "start": 625,
        "end": 628,
        "fields": {
          "code": {
            "type": "Code",
            "start": 625,
            "end": 628,
            "text": "304"
          }
        },
        "value": {
          "code": "304",
          "class": "redirect"
        }
      },
      "agent": {
        "type": "Quoted",
        "start": 636,
        "end": 707,
        "text": "Sogou web spider/4.0(+http://www.sogou.com/docs/help/webmasters.htm#07)"
      }
    }
  },
  {
    "type": "Entry",
    "start": 709,
    "end": 919,
    "fields": {
      "client": {
        "type": "Address",
        "start": 709,
        "end": 718,
        "text": "192.0.2.4"
      },
      "time": {
        "type": "Timestamp",
        "start": 723,
        "end": 751,
        "fields": {
          "day": {
            "type": "Day",
            "start": 724,
            "end": 726,
            "text": "17"
          },
          "month": {
            "type": "Month::May",
            "start": 727,
            "end": 730,
            "text": "May",
            "value": "05"
          },
          "year": {
            "type": "Year",
            "start": 731,
            "end": 735,
            "text": "2015"
          },
          "hour": {
            "type": "Clock",
            "start": 736,
            "end": 738,
            "text": "11"
          },
          "minute": {
            "type": "Clock",
            "start": 739,
            "end": 741,
            "text": "05"
          },
          "second": {
            "type": "Clock",
            "start": 742,
            "end": 744,
            "text": "47"
          },
          "sign": {
            "type": "Sign",
            "start": 745,
            "end": 746,
            "text": "+"
          },
          "offset_hours": {
            "type": "Clock",
            "start": 746,
            "end": 748,
            "text": "00"
          },
          "offset_minutes": {
            "type": "Clock",
            "start": 748,
            "end": 750,
            "text": "00"
          }
        },
        "value": "2015-05-17T11:05:47+00:00"
      },
      "request": {
        "type": "Request",
        "start": 753,
        "end": 783,
        "fields": {
          "method": {
            "type": "Method",
            "start": 753,
            "end": 756,
            "text": "GET"
          },
          "path": {
            "type": "Path",
            "start": 757,
            "end": 774,
            "text": "/projects/xdotool"
          },
          "protocol": {
            "type": "Protocol",
            "start": 775,
            "end": 783,
            "text": "HTTP/1.1"
          }
        }
      },
      "status": {
        "type": "Status::Redirect",
        "start": 785,
        "end": 788,
        "fields": {
          "code": {
            "type": "Code",
            "start": 785,
            "end": 788,
            "text": "301"
          }
        },
        "value": {
          "code": "301",
          "class": "redirect"
        }
      },
      "size": {
        "type": "Size",
        "start": 789,
        "end": 792,
        "text": "339"
      },
      "referrer": {
        "type": "Quoted",
        "start": 794,
        "end": 847,
        "text": "http://tuxradar.com/content/xdotool-script-your-mouse"
      },
      "agent": {
        "type": "Quoted",
        "start": 850,
        "end": 918,
        "text": "Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0"
      }
    }
  },
  {
    "type": "Entry",
    "start": 920,
    "end": 1143,
    "fields": {
      "client": {
        "type": "Address",
        "start": 920,
        "end": 929,
        "text": "192.0.2.5"
      },
      "time": {
        "type": "Timestamp",
        "start": 934,
        "end": 962,
        "fields": {
          "day": {
            "type": "Day",
            "start": 935,
            "end": 937,
            "text": "17"
          },
          "month": {
            "type": "Month::May",
            "start": 938,
            "end": 941,
            "text": "May",
            "value": "05"
          },
          "year": {
            "type": "Year",
            "start": 942,
            "end": 946,
            "text": "2015"
          },
          "hour": {
            "type": "Clock",
            "start": 947,
            "end": 949,
            "text": "14"
          },
          "minute": {
            "type": "Clock",
            "start": 950,
            "end": 952,
            "text": "05"
          },
          "second": {
            "type": "Clock",
            "start": 953,
            "end": 955,
            "text": "30"
          },
          "sign": {
            "type": "Sign",
            "start": 956,
            "end": 957,
            "text": "+"
          },
          "offset_hours": {
            "type": "Clock",
            "start": 957,
            "end": 959,
            "text": "00"
          },
          "offset_minutes": {
            "type": "Clock",
            "start": 959,
            "end": 961,
            "text": "00"
          }
        },
        "value": "2015-05-17T14:05:30+00:00"
      },
      "request": {
        "type": "Request",
        "start": 964,
        "end": 1052,
        "fields": {
          "method": {
            "type": "Method",
            "start": 964,
            "end": 967,
            "text": "GET"
          },
          "path": {
            "type": "Path",
            "start": 968,
            "end": 1043,
            "text": "/presentations/logstash-puppetconf-2012/images/apache-negative-duration.png"
          },
          "protocol": {
            "type": "Protocol",
            "start": 1044,
            "end": 1052,
            "text": "HTTP/1.1"
          }
        }
      },
      "status": {
        "type": "Status::Success",
        "start": 1054,
        "end": 1057,
        "fields": {
          "code": {
            "type": "Code",
            "start": 1054,
            "end": 1057,
            "text": "206"
          }
        },
        "value": {
          "code": "206",
          "class": "success"
        }
      },
      "size": {
        "type": "Size",
        "start": 1058,
        "end": 1063,
        "text": "97173"
      },
      "agent": {
        "type": "Quoted",
        "start": 1069,
        "end": 1142,
        "text": "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)"
      }
    }
  },
  {
    "type": "Entry",
    "start": 1144,
    "end": 1306,
    "fields": {
      "client": {
        "type": "Address",
        "start": 1144,
        "end": 1153,
        "text": "192.0.2.6"
      },
      "time": {
        "type": "Timestamp",
        "start": 1158,
        "end": 1186,
        "fields": {
          "day": {
            "type": "Day",
            "start": 1159,
            "end": 1161,
            "text": "17"
          },
          "month": {
            "type": "Month::May",
            "start": 1162,
            "end": 1165,
            "text": "May",
            "value": "05"
          },
          "year": {
            "type": "Year",
            "start": 1166,
            "end": 1170,
            "text": "2015"
          },
          "hour": {
            "type": "Clock",
            "start": 1171,
            "end": 1173,
            "text": "16"
          },
          "minute": {
            "type": "Clock",
            "start": 1174,
            "end": 1176,
            "text": "05"
          },
          "second": {
            "type": "Clock",
            "start": 1177,
            "end": 1179,
            "text": "27"
          },
          "sign": {
            "type": "Sign",
            "start": 1180,
            "end": 1181,
            "text": "+"
          },
          "offset_hours": {
            "type": "Clock",
            "start": 1181,
            "end": 1183,
            "text": "00"
          },
          "offset_minutes": {
            "type": "Clock",
            "start": 1183,
            "end": 1185,
            "text": "00"
          }
        },
        "value": "2015-05-17T16:05:27+00:00"
      },
      "request": {
        "type": "Request",
        "start": 1188,
        "end": 1220,
        "fields": {
          "method": {
            "type": "Method",
            "start": 1188,
            "end": 1192,
            "text": "HEAD"
          },
          "path": {
            "type": "Path",
            "start": 1193,
            "end": 1211,
            "text": "/projects/xdotool/"
          },
          "protocol": {
            "type": "Protocol",
            "start": 1212,
            "end": 1220,
            "text": "HTTP/1.1"
          }
        }
      },
      "status": {
        "type": "Status::Success",
        "start": 1222,
        "end": 1225,
        "fields": {
          "code": {
            "type": "Code",
            "start": 1222,
            "end": 1225,
            "text": "200"
          }
        },
        "value": {
          "code": "200",
          "class": "success"
        }
      },
      "agent": {
        "type": "Quoted",
        "start": 1233,
        "end": 1305,
        "text": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0"
      }
    }
  },
  {
    "type": "Entry",
    "start": 1307,
    "end": 1469,
    "fields": {
      "client": {
        "type": "Address",
        "start": 1307,
        "end": 1316,
        "text": "192.0.2.7"
      },
      "time": {
        "type": "Timestamp",
        "start": 1321,
        "end": 1349,
        "fields": {
          "day": {
            "type": "Day",
            "start": 1322,
            "end": 1324,
            "text": "18"
          },
          "month": {
            "type": "Month::May",
            "start": 1325,
            "end": 1328,
            "text": "May",
            "value": "05"
          },
          "year": {
            "type": "Year",
            "start": 1329,
            "end": 1333,
            "text": "2015"
          },
          "hour": {
            "type": "Clock",
            "start": 1334,
            "end": 1336,
            "text": "03"
          },
          "minute": {
            "type": "Clock",
            "start": 1337,
            "end": 1339,
            "text": "05"
          },
          "second": {
            "type": "Clock",
            "start": 1340,
            "end": 1342,
            "text": "34"
          },
          "sign": {
            "type": "Sign",
            "start": 1343,
            "end": 1344,
            "text": "+"
          },
          "offset_hours": {
            "type": "Clock",
            "start": 1344,
            "end": 1346,
            "text": "00"
          },
          "offset_minutes": {
            "type": "Clock",
            "start": 1346,
            "end": 1348,
            "text": "00"
          }
        },
        "value": "2015-05-18T03:05:34+00:00"
      },
      "request": {
        "type": "Request",
        "start": 1351,
        "end": 1383,
        "fields": {
          "method": {
            "type": "Method",
            "start": 1351,
            "end": 1354,
            "text": "GET"
          },
          "path": {
            "type": "Path",
            "start": 1355,
            "end": 1374,
            "text": "/misc/Title.php.txt"
          },
          "protocol": {
            "type": "Protocol",
            "start": 1375,
            "end": 1383,
            "text": "HTTP/1.1"
          }
        }
      },
      "status": {
        "type": "Status::ServerError",
        "start": 1385,
        "end": 1388,
        "fields": {
          "code": {
            "type": "Code",
            "start": 1385,
            "end": 1388,
            "text": "500"
          }
        },
        "value": {
          "code": "500",
          "class": "server error"
        }
      },
      "agent": {
        "type": "Quoted",
        "start": 1396,
        "end": 1468,
        "text": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
      }
    }
  },
  {
    "type": "Entry",
    "start": 1470,
    "end": 2830,
    "fields": {
      "client": {
        "type": "Address",
        "start": 1470,
        "end": 1479,
        "text": "192.0.2.8"
      },
      "time": {
        "type": "Timestamp",
        "start": 1484,
        "end": 1512,
        "fields": {
          "day": {
            "type": "Day",
            "start": 1485,
            "end": 1487,
            "text": "18"
          },
          "month": {
            "type": "Month::May",
            "start": 1488,
            "end": 1491,
            "text": "May",
            "value": "05"
          },
          "year": {
            "type": "Year",
            "start": 1492,
            "end": 1496,
            "text": "2015"
          },
          "hour": {
            "type": "Clock",
            "start": 1497,
            "end": 1499,
            "text": "11"
          },
          "minute": {
            "type": "Clock",
            "start": 1500,
            "end": 1502,
            "text": "05"
          },
          "second": {
            "type": "Clock",
            "start": 1503,
            "end": 1505,
            "text": "47"
          },
          "sign": {
            "type": "Sign",
            "start": 1506,
            "end": 1507,
            "text": "+"
          },
          "offset_hours": {
            "type": "Clock",
            "start": 1507,
            "end": 1509,
            "text": "00"
          },
          "offset_minutes": {
            "type": "Clock",
            "start": 1509,
            "end": 1511,
            "text": "00"
          }
        },
        "value": "2015-05-18T11:05:47+00:00"
      },
      "request": {
        "type": "Request",
        "start": 1514,
        "end": 2122,
        "fields": {
          "method": {
            "type": "Method",
            "start": 1514,
            "end": 1517,
            "text": "GET"
          },
          "path": {
            "type": "Path",
            "start": 1518,
            "end": 2113,
            "text": "/presentations/vim/+++++++++++++++++++++++++++++++++++Result:+%E8%F1%EF%EE%EB%FC%E7%EE%E2%E0%ED+%ED%E8%EA%ED%E5%E9%EC+%22newkoversjup%22;+ReCaptcha+%E4%E5%F8%E8%F4%F0%EE%E2%E0%ED%E0;+%28JS%29;+%E7%E0%F0%E5%E3%E8%F1%F2%F0%E8%F0%EE%E2%E0%EB%E8%F1%FC;+%ED%E5+%ED%E0%F8%EB%EE%F1%FC+%F4%EE%F0%EC%FB+%E4%EB%FF+%EE%F2%EF%F0%E0%E2%EA%E8;+Result:+%EE%F8%E8%E1%EA%E0:+%22i+never+really+liked+c%27s+assert%28%29+feature.+if+an+assertion+is+violated,+it%27lltell+you+what+assertion+failed+but+completely+lacks+any+context:%22;+%ED%E5+%ED%E0%F8%EB%EE%F1%FC+%F4%EE%F0%EC%FB+%E4%EB%FF+%EE%F2%EF%F0%E0%E2%EA%E8;"
          },
          "protocol": {
            "type": "Protocol",
            "start": 2114,
            "end": 2122,
            "text": "HTTP/1.0"
          }
        }
      },
      "status": {
        "type": "Status::ClientError",
        "start": 2124,
        "end": 2127,
        "fields": {
          "code": {
            "type": "Code",
            "start": 2124,
            "end": 2127,
            "text": "403"
          }
        },
        "value": {
          "code": "403",
          "class": "client error"
        }
      },
      "size": {
        "type": "Size",
        "start": 2128,
        "end": 2131,
        "text": "676"
      },
      "referrer": {
        "type": "Quoted",
        "start": 2133,
        "end": 2755,
        "text": "http://www.semicomplete.com/presentations/vim/+++++++++++++++++++++++++++++++++++Result:+%E8%F1%EF%EE%EB%FC%E7%EE%E2%E0%ED+%ED%E8%EA%ED%E5%E9%EC+%22newkoversjup%22;+ReCaptcha+%E4%E5%F8%E8%F4%F0%EE%E2%E0%ED%E0;+%28JS%29;+%E7%E0%F0%E5%E3%E8%F1%F2%F0%E8%F0%EE%E2%E0%EB%E8%F1%FC;+%ED%E5+%ED%E0%F8%EB%EE%F1%FC+%F4%EE%F0%EC%FB+%E4%EB%FF+%EE%F2%EF%F0%E0%E2%EA%E8;+Result:+%EE%F8%E8%E1%EA%E0:+%22i+never+really+liked+c%27s+assert%28%29+feature.+if+an+assertion+is+violated,+it%27lltell+you+what+assertion+failed+but+completely+lacks+any+context:%22;+%ED%E5+%ED%E0%F8%EB%EE%F1%FC+%F4%EE%F0%EC%FB+%E4%EB%FF+%EE%F2%EF%F0%E0%E2%EA%E8;"
      },
      "agent": {
        "type": "Quoted",
        "start": 2758,
        "end": 2829,
        "text": "Opera/9.80 (Windows NT 6.1; WOW64; U; ru) Presto/2.10.289 Version/12.01"
      }
    }
  },
  {
    "type": "Entry",
    "start": 2831,
    "end": 3105,
    "fields": {
      "client": {
        "type": "Address",
        "start": 2831,
        "end": 2840,
        "text": "192.0.2.9"
      },
      "time": {
        "type": "Timestamp",
        "start": 2845,
        "end": 2873,
        "fields": {
          "day": {
            "type": "Day",
            "start": 2846,
            "end": 2848,
            "text": "19"
          },
          "month": {
            "type": "Month::May",
            "start": 2849,
            "end": 2852,
            "text": "May",
            "value": "05"
          },
          "year": {
            "type": "Year",
            "start": 2853,
            "end": 2857,
            "text": "2015"
          },
          "hour": {
            "type": "Clock",
            "start": 2858,
            "end": 2860,
            "text": "04"
          },
          "minute": {
            "type": "Clock",
            "start": 2861,
            "end": 2863,
            "text": "05"
          },
          "second": {
            "type": "Clock",
            "start": 2864,
            "end": 2866,
            "text": "16"
          },
          "sign": {
            "type": "Sign",
            "start": 2867,
            "end": 2868,
            "text": "+"
          },
          "offset_hours": {
            "type": "Clock",
            "start": 2868,
            "end": 2870,
            "text": "00"
          },
          "offset_minutes": {
            "type": "Clock",
            "start": 2870,
            "end": 2872,
            "text": "00"
          }
        },
        "value": "2015-05-19T04:05:16+00:00"
      },
      "request": {
        "type": "Request",
        "start": 2875,
        "end": 2915,
        "fields": {
          "method": {
            "type": "Method",
            "start": 2875,
            "end": 2879,
            "text": "POST"
          },
          "path": {
            "type": "Path",
            "start": 2880,
            "end": 2906,
            "text": "/blog/geekery/xvfb-firefox"
          },
          "protocol": {
            "type": "Protocol",
            "start": 2907,
            "end": 2915,
            "text": "HTTP/1.0"
          }
        }
      },
      "status": {
        "type": "Status::Success",
        "start": 2917,
        "end": 2920,
        "fields": {
          "code": {
            "type": "Code",
            "start": 2917,
            "end": 2920,
            "text": "200"
          }
        },
        "value": {
          "code": "200",
          "class": "success"
        }
      },
      "size": {
        "type": "Size",
        "start": 2921,
        "end": 2926,
        "text": "10975"
      },
      "referrer": {
        "type": "Quoted",
        "start": 2928,
        "end": 2993,
        "text": "http://zoomq.qiniudn.com/ZQScrapBook/ZqFLOSS/data/20110811235550/"
      },
      "agent": {
        "type": "Quoted",
        "start": 2996,
        "end": 3104,
        "text": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.91 Safari/537.11"
      }
    }
  },
  {
    "type": "Entry",
    "start": 3106,
    "end": 3246,
    "fields": {
      "client": {
        "type": "Address",
        "start": 3106,
        "end": 3116,
        "text": "192.0.2.10"
      },
      "time": {
        "type": "Timestamp",
        "start": 3121,
        "end": 3149,
        "fields": {
          "day": {
            "type": "Day",
            "start": 3122,
            "end": 3124,
            "text": "19"
          },
          "month": {
            "type": "Month::May",
            "start": 3125,
            "end": 3128,
            "text": "May",
            "value": "05"
          },
          "year": {
            "type": "Year",
            "start": 3129,
            "end": 3133,
            "text": "2015"
          },
          "hour": {
            "type": "Clock",
            "start": 3134,
            "end": 3136,
            "text": "06"
          },
          "minute": {
            "type": "Clock",
            "start": 3137,
            "end": 3139,
            "text": "05"
          },
          "second": {
            "type": "Clock",
            "start": 3140,
            "end": 3142,
            "text": "17"
          },
          "sign": {
            "type": "Sign",
            "start": 3143,
            "end": 3144,
            "text": "+"
          },
          "offset_hours": {
            "type": "Clock",
            "start": 3144,
            "end": 3146,
            "text": "00"
          },
          "offset_minutes": {
            "type": "Clock",
            "start": 3146,
            "end": 3148,
            "text": "00"
          }
        },
        "value": "2015-05-19T06:05:17+00:00"
      },
      "request": {
        "type": "Request",
        "start": 3151,
        "end": 3209,
        "fields": {
          "method": {
            "type": "Method",
            "start": 3151,
            "end": 3154,
            "text": "GET"
          },
          "path": {
            "type": "Path",
            "start": 3155,
            "end": 3200,
            "text": "/files/xdotool/xdotool-2.20101014.3063.tar.gz"
          },
          "protocol": {
            "type": "Protocol",
            "start": 3201,
            "end": 3209,
            "text": "HTTP/1.1"
          }
        }
      },
      "status": {
        "type": "Status::ClientError",
        "start": 3211,
        "end": 3214,
        "fields": {
          "code": {
            "type": "Code",
            "start": 3211,
            "end": 3214,
            "text": "416"
          }
        },
        "value": {
          "code": "416",
          "class": "client error"
        }
      },
      "size": {
        "type": "Size",
        "start": 3215,
        "end": 3218,
        "text": "400"
      },
      "agent": {
        "type": "Quoted",
        "start": 3224,
        "end": 3245,
        "text": "Wget/1.14 (linux-gnu)"
      }
    }
  },
  {
    "type": "Entry",
    "start": 3247,
    "end": 3378,
    "fields": {
      "client": {
        "type": "Address",
        "start": 3247,
        "end": 3257,
        "text": "192.0.2.11"
      },
      "time": {
        "type": "Timestamp",
        "start": 3262,
        "end": 3290,
        "fields": {
          "day": {
            "type": "Day",
            "start": 3263,
            "end": 3265,
            "text": "20"
          },
          "month": {
            "type": "Month::May",
            "start": 3266,
            "end": 3269,
            "text": "May",
            "value": "05"
          },
          "year": {
            "type": "Year",
            "start": 3270,
            "end": 3274,
            "text": "2015"
          },
          "hour": {
            "type": "Clock",
            "start": 3275,
            "end": 3277,
            "text": "14"
          },
          "minute": {
            "type": "Clock",
            "start": 3278,
            "end": 3280,
            "text": "05"
          },
          "second": {
            "type": "Clock",
            "start": 3281,
            "end": 3283,
            "text": "16"
          },
          "sign": {
            "type": "Sign",
            "start": 3284,
            "end": 3285,
            "text": "+"
          },
          "offset_hours": {
            "type": "Clock",
            "start": 3285,
            "end": 3287,
            "text": "00"
          },
          "offset_minutes": {
            "type": "Clock",
            "start": 3287,
            "end": 3289,
            "text": "00"
          }
        },
        "value": "2015-05-20T14:05:16+00:00"
      },
      "request": {
        "type": "Request",
        "start": 3292,
        "end": 3327,
        "fields": {
          "method": {
            "type": "Method",
            "start": 3292,
            "end": 3299,
            "text": "OPTIONS"
          },
          "path": {
            "type": "Path",
            "start": 3300,
            "end": 3318,
            "text": "/projects/xdotool/"
          },
          "protocol": {
            "type": "Protocol",
            "start": 3319,
            "end": 3327,
            "text": "HTTP/1.1"
          }
        }
      },
      "status": {
        "type": "Status::ServerError",
        "start": 3329,
        "end": 3332,
        "fields": {
          "code": {
            "type": "Code",
            "start": 3329,
            "end": 3332,
            "text": "500"
          }
        },
        "value": {
          "code": "500",
          "class": "server error"
        }
      },
      "size": {
        "type": "Size",
        "start": 3333,
        "end": 3336,
        "text": "626"
      },
      "agent": {
        "type": "Quoted",
        "start": 3342,
        "end": 3377,
        "text": "Microsoft Office Protocol Discovery"
      }
    }
  }
]

About this spec

Requests in web server access logs in the Apache combined and common formats: one request per line with its client address, time, method, path, query, protocol, status with its class, response size, referrer and user agent.

Package files

  • logs.yml
  • samples/variants.txt
  • tests/expected/sample.yaml
  • tests/expected/variants.yaml
  • tests/logs.test.yml
  • texomy.json

222 nodes from 11 top-level matches.

Run it yourself

Save the example from Studio to a folder, then in that folder:

texomy parse input.txt -m logs
texomy test

Write the spec once. Run it on everything.

Install the CLI, connect your agent, and turn your first sample into typed data in minutes.

brew install texomy/tap/texomy