Class: HAProxyLogParser::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/haproxy_log_parser/entry.rb

Overview

An instance of this class represents a line/entry of an HAProxy log in the HTTP format. See the “Logging > Log formats > HTTP log format” section in HAProxy’s configuration.txt for documentation of fields/attributes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#accept_dateTime

Returns:

  • (Time)


13
14
15
# File 'lib/haproxy_log_parser/entry.rb', line 13

def accept_date
  @accept_date
end

#actconnInteger

Returns:

  • (Integer)


60
61
62
# File 'lib/haproxy_log_parser/entry.rb', line 60

def actconn
  @actconn
end

#backend_nameString

Returns:

  • (String)


24
25
26
# File 'lib/haproxy_log_parser/entry.rb', line 24

def backend_name
  @backend_name
end

#backend_queueInteger

Returns:

  • (Integer)


78
79
80
# File 'lib/haproxy_log_parser/entry.rb', line 78

def backend_queue
  @backend_queue
end

#beconnInteger

Returns:

  • (Integer)


66
67
68
# File 'lib/haproxy_log_parser/entry.rb', line 66

def beconn
  @beconn
end

#bytes_readInteger

Returns:

  • (Integer)


48
49
50
# File 'lib/haproxy_log_parser/entry.rb', line 48

def bytes_read
  @bytes_read
end

Returns:

  • (Hash{String => String})


51
52
53
# File 'lib/haproxy_log_parser/entry.rb', line 51

def captured_request_cookie
  @captured_request_cookie
end

#captured_request_headersArray<String>

Returns:

  • (Array<String>)


81
82
83
# File 'lib/haproxy_log_parser/entry.rb', line 81

def captured_request_headers
  @captured_request_headers
end

Returns:

  • (Hash{String => String})


54
55
56
# File 'lib/haproxy_log_parser/entry.rb', line 54

def captured_response_cookie
  @captured_response_cookie
end

#captured_response_headersArray<String>

Returns:

  • (Array<String>)


84
85
86
# File 'lib/haproxy_log_parser/entry.rb', line 84

def captured_response_headers
  @captured_response_headers
end

#client_ipString

Returns:

  • (String)


7
8
9
# File 'lib/haproxy_log_parser/entry.rb', line 7

def client_ip
  @client_ip
end

#client_portInteger

Returns:

  • (Integer)


10
11
12
# File 'lib/haproxy_log_parser/entry.rb', line 10

def client_port
  @client_port
end

#feconnInteger

Returns:

  • (Integer)


63
64
65
# File 'lib/haproxy_log_parser/entry.rb', line 63

def feconn
  @feconn
end

#frontend_nameString

Returns:

  • (String)


16
17
18
# File 'lib/haproxy_log_parser/entry.rb', line 16

def frontend_name
  @frontend_name
end

#http_requestString

Returns:

  • (String)


87
88
89
# File 'lib/haproxy_log_parser/entry.rb', line 87

def http_request
  @http_request
end

#retriesInteger

Returns:

  • (Integer)


72
73
74
# File 'lib/haproxy_log_parser/entry.rb', line 72

def retries
  @retries
end

#server_nameString

Returns:

  • (String)


27
28
29
# File 'lib/haproxy_log_parser/entry.rb', line 27

def server_name
  @server_name
end

#srv_connInteger

Returns:

  • (Integer)


69
70
71
# File 'lib/haproxy_log_parser/entry.rb', line 69

def srv_conn
  @srv_conn
end

#srv_queueInteger

Returns:

  • (Integer)


75
76
77
# File 'lib/haproxy_log_parser/entry.rb', line 75

def srv_queue
  @srv_queue
end

#status_codeInteger

Returns:

  • (Integer)


45
46
47
# File 'lib/haproxy_log_parser/entry.rb', line 45

def status_code
  @status_code
end

#tcInteger

Returns:

  • (Integer)


36
37
38
# File 'lib/haproxy_log_parser/entry.rb', line 36

def tc
  @tc
end

#termination_stateString

Returns:

  • (String)


57
58
59
# File 'lib/haproxy_log_parser/entry.rb', line 57

def termination_state
  @termination_state
end

#tqInteger

Returns:

  • (Integer)


30
31
32
# File 'lib/haproxy_log_parser/entry.rb', line 30

def tq
  @tq
end

#trInteger

Returns:

  • (Integer)


39
40
41
# File 'lib/haproxy_log_parser/entry.rb', line 39

def tr
  @tr
end

#transport_modeString

Returns ‘~’ if SSL, ” otherwise (HAProxy 1.5 adds a ‘~’ suffix to the frontend name if request went through SSL).

Returns:

  • (String)

    ‘~’ if SSL, ” otherwise (HAProxy 1.5 adds a ‘~’ suffix to the frontend name if request went through SSL)



21
22
23
# File 'lib/haproxy_log_parser/entry.rb', line 21

def transport_mode
  @transport_mode
end

#ttInteger

Returns:

  • (Integer)


42
43
44
# File 'lib/haproxy_log_parser/entry.rb', line 42

def tt
  @tt
end

#twInteger

Returns:

  • (Integer)


33
34
35
# File 'lib/haproxy_log_parser/entry.rb', line 33

def tw
  @tw
end

Instance Method Details

#ssl?Boolean

return [true, false] true if and only if request was SSL

Returns:

  • (Boolean)


90
91
92
# File 'lib/haproxy_log_parser/entry.rb', line 90

def ssl?
  @transport_mode == '~'
end