Codebase list goaccess / control/main goaccess.1
control/main

Tree @control/main (Download .tar.gz)

goaccess.1 @control/mainraw · history · blame

   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
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
.TH goaccess 1 "JANUARY 2022" GNU+Linux "User Manuals"
.SH NAME
goaccess \- fast web log analyzer and interactive viewer.
.SH SYNOPSIS
.LP
.B goaccess [filename] [options...] [-c][-M][-H][-q][-d][...]
.SH DESCRIPTION
.B goaccess
GoAccess is an open source real-time web log analyzer and interactive viewer
that runs in a
.I terminal
in *nix systems or through your
.I browser.
.P
It provides fast and valuable HTTP statistics for system administrators that
require a visual server report on the fly.
.P
GoAccess parses the specified web log file and outputs the data to the X
terminal. Features include:

.IP "General Statistics:"
This panel gives a summary of several metrics, such as the number of valid and
invalid requests, time taken to analyze the dataset, unique visitors, requested
files, static files (CSS, ICO, JPG, etc) HTTP referrers, 404s, size of the
parsed log file and bandwidth consumption.
.IP "Unique visitors"
This panel shows metrics such as hits, unique visitors and cumulative bandwidth
per date. HTTP requests containing the same IP, the same date, and the same
user agent are considered a unique visitor. By default, it includes web
crawlers/spiders.
.IP
Optionally, date specificity can be set to the hour level using
.I --date-spec=hr
which will display dates such as 05/Jun/2016:16. This is great if you want to
track your daily traffic at the hour level.
.IP "Requested files"
This panel displays the most requested (non-static) files on your web server.
It shows hits, unique visitors, and percentage, along with the cumulative
bandwidth, protocol, and the request method used.
.IP "Requested static files"
Lists the most frequently static files such as: JPG, CSS, SWF, JS, GIF, and PNG
file types, along with the same metrics as the last panel. Additional static
files can be added to the configuration file.
.IP "404 or Not Found"
Displays the same metrics as the previous request panels, however, its data
contains all pages that were not found on the server, or commonly known as 404
status code.
.IP "Hosts"
This panel has detailed information on the hosts themselves. This is great for
spotting aggressive crawlers and identifying who's eating your bandwidth.

Expanding the panel can display more information such as host's reverse DNS
lookup result, country of origin and city. If the
.I -a
argument is enabled, a list of user agents can be displayed by selecting the
desired IP address, and then pressing ENTER.
.IP "Operating Systems"
This panel will report which operating system the host used when it hit the
server. It attempts to provide the most specific version of each operating
system.
.IP "Browsers"
This panel will report which browser the host used when it hit the server. It
attempts to provide the most specific version of each browser.
.IP "Visit Times"
This panel will display an hourly report. This option displays 24 data points,
one for each hour of the day.
.IP
Optionally, hour specificity can be set to the tenth of an hour level using
.I --hour-spec=min
which will display hours as 16:4 This is great if you want to spot peaks of
traffic on your server.
.IP "Virtual Hosts"
This panel will display all the different virtual hosts parsed from the access
log. This panel is displayed if
.I %v
is used within the log-format string.
.IP "Referrers URLs"
If the host in question accessed the site via another resource, or was
linked/diverted to you from another host, the URL they were referred from will
be provided in this panel. See `--ignore-panel` in your configuration file to
enable it.
.I disabled
by default.
.IP "Referring Sites"
This panel will display only the host part but not the whole URL. The URL where
the request came from.
.IP "Keyphrases"
It reports keyphrases used on Google search, Google cache, and Google translate
that have lead to your web server. At present, it only supports Google search
queries via HTTP. See `--ignore-panel` in your configuration file to enable it.
.I disabled
by default.
.IP "Geo Location"
Determines where an IP address is geographically located. Statistics are broken
down by continent and country. It needs to be compiled with GeoLocation
support.
.IP "HTTP Status Codes"
The values of the numeric status code to HTTP requests.
.IP "Remote User (HTTP authentication)"
This is the userid of the person requesting the document as determined by HTTP
authentication. If the document is not password protected, this part will be
"-" just like the previous one. This panel is not enabled unless
.I %e
is given within the log-format variable.
.IP "Cache Status"
If you are using caching on your server, you may be at the point where you
want to know if your request is being cached and served from the cache. This
panel shows the cache status of the object the server served. This panel is not
enabled unless
.I %C
is given within the log-format variable. The status can be either
 `MISS`, `BYPASS`, `EXPIRED`, `STALE`, `UPDATING`, `REVALIDATED` or `HIT`
.IP "MIME Types"
This panel specifies Media Types (formerly known as MIME types) and Media
Subtypes which will be assigned and listed underneath. This panel is not
enabled unless
.I %M
is given within the log-format variable. See
https://www.iana.org/assignments/media-types/media-types.xhtml for more
details.
.IP "Encryption Settings"
This panel shows the SSL/TLS protocol used along the Cipher Suites. This panel
is not enabled unless
.I %K
is given within the log-format variable.

.P
.I NOTE:
Optionally and if configured, all panels can display the average time taken to
serve the request.

.SH STORAGE
.P
There are three storage options that can be used with GoAccess. Choosing one
will depend on your environment and needs.
.TP
Default Hash Tables
In-memory storage provides better performance at the cost of limiting the
dataset size to the amount of available physical memory. GoAccess uses
in-memory hash tables. It has very good memory usage and pretty good
performance. This storage has support for on-disk persistence.
.SH CONFIGURATION
.P
Multiple options can be used to configure GoAccess. For a complete up-to-date
list of configure options, run
.I ./configure --help
.TP
\fB\-\-enable-debug
Compile with debugging symbols and turn off compiler optimizations.
.TP
\fB\-\-enable-utf8
Compile with wide character support. Ncursesw is required.
.TP
\fB\-\-enable-geoip=<legacy|mmdb>
Compile with GeoLocation support. MaxMind's GeoIP is required.
.I legacy
will utilize the original GeoIP databases.
.I mmdb
will utilize the enhanced GeoIP2 databases.
.TP
\fB\-\-with-getline
Dynamically expands line buffer in order to parse full line requests instead of
using a fixed size buffer of 4096.
.TP
\fB\-\-with-openssl
Compile GoAccess with OpenSSL support for its WebSocket server.
.SH OPTIONS
.P
The following options can be supplied to the command or specified in the
configuration file. If specified in the configuration file, long options need
to be used without prepending -- and without using the equal sign =.
.SS
LOG/DATE/TIME FORMAT
.TP
\fB\-\-time-format=<timeformat>
The time-format variable followed by a space, specifies the log format time
containing either a name of a predefined format (see options below) or any
combination of regular characters and special format specifiers.
.IP
They all begin with a percentage (%) sign. See `man strftime`.
.I %T or %H:%M:%S.
.IP
Note that if a timestamp is given in microseconds,
.I %f
must be used as time-format.
If the timestamp is given in milliseconds
.I %*
must be used as time-format.
.TP
\fB\-\-date-format=<dateformat>
The date-format variable followed by a space, specifies the log format time
containing either a name of a predefined format (see options below) or any
combination of regular characters and special format specifiers.
.IP
They all begin with a percentage (%) sign. See `man strftime`.
.I %Y-%m-%d.
.IP
Note that if a timestamp is given in microseconds,
.I
%f
must be used as date-format.
If the timestamp is given in milliseconds
.I %*
must be used as date-format.
.TP
\fB\-\-log-format=<logformat>
The log-format variable followed by a space or
.I \\\\t
for tab-delimited, specifies the log format string.

Note that if there are spaces within the format, the string needs to be
enclosed in single/double quotes. Inner quotes need to be escaped.
.IP
In addition to specifying the raw log/date/time formats, for simplicity, any of
the following predefined log format names can be supplied to the
log/date/time-format variables. GoAccess can also handle one predefined name in
one variable and another predefined name in another variable.
.IP
  COMBINED     - Combined Log Format,
  VCOMBINED    - Combined Log Format with Virtual Host,
  COMMON       - Common Log Format,
  VCOMMON      - Common Log Format with Virtual Host,
  W3C          - W3C Extended Log File Format,
  SQUID        - Native Squid Log Format,
  CLOUDFRONT   - Amazon CloudFront Web Distribution,
  CLOUDSTORAGE - Google Cloud Storage,
  AWSELB       - Amazon Elastic Load Balancing,
  AWSS3        - Amazon Simple Storage Service (S3)
  AWSALB       - Amazon Application Load Balancer
  CADDY        - Caddy's JSON Structured format
.IP
.I Note:
Piping data into GoAccess won't prompt a log/date/time configuration dialog,
you will need to previously define it in your configuration file or in the
command line.
.SS
USER INTERFACE OPTIONS
.TP
\fB\-c \-\-config-dialog
Prompt log/time/date configuration window on program start. Only when curses is
initialized.
.TP
\fB\-i \-\-hl-header
Color highlight active terminal panel.
.TP
\fB\-m \-\-with-mouse
Enable mouse support on main terminal dashboard.
.TP
\fB\-\-\-color=<fg:bg[attrs, PANEL]>
Specify custom colors for the terminal output.

.I Color Syntax
  DEFINITION space/tab colorFG#:colorBG# [attributes,PANEL]

 FG# = foreground color [-1...255] (-1 = default term color)
 BG# = background color [-1...255] (-1 = default term color)

Optionally, it is possible to apply color attributes (multiple attributes are
comma separated), such as:
.I bold,
.I underline,
.I normal,
.I reverse,
.I blink

If desired, it is possible to apply custom colors per panel, that is, a metric
in the REQUESTS panel can be of color A, while the same metric in the BROWSERS
panel can be of color B.

.I Available color definitions:
  COLOR_MTRC_HITS
  COLOR_MTRC_VISITORS
  COLOR_MTRC_DATA
  COLOR_MTRC_BW
  COLOR_MTRC_AVGTS
  COLOR_MTRC_CUMTS
  COLOR_MTRC_MAXTS
  COLOR_MTRC_PROT
  COLOR_MTRC_MTHD
  COLOR_MTRC_HITS_PERC
  COLOR_MTRC_HITS_PERC_MAX
  COLOR_MTRC_VISITORS_PERC
  COLOR_MTRC_VISITORS_PERC_MAX
  COLOR_PANEL_COLS
  COLOR_BARS
  COLOR_ERROR
  COLOR_SELECTED
  COLOR_PANEL_ACTIVE
  COLOR_PANEL_HEADER
  COLOR_PANEL_DESC
  COLOR_OVERALL_LBLS
  COLOR_OVERALL_VALS
  COLOR_OVERALL_PATH
  COLOR_ACTIVE_LABEL
  COLOR_BG
  COLOR_DEFAULT
  COLOR_PROGRESS

See configuration file for a sample color scheme.
.TP
\fB\-\-color-scheme=<1|2|3>
Choose among color schemes.
.I 1
for the default grey scheme.
.I 2
for the green scheme.
.I 3
for the Monokai scheme (shown only if terminal supports 256 colors).
.TP
\fB\-\-crawlers-only
Parse and display only crawlers (bots).
.TP
\fB\-\-html-custom-css=<path/custom.css>
Specifies a custom CSS file path to load in the HTML report.
.TP
\fB\-\-html-custom-js=<path/custom.js>
Specifies a custom JS file path to load in the HTML report.
.TP
\fB\-\-html-report-title=<title>
Set HTML report page title and header.
.TP
\fB\-\-html-refresh=<secs>
Refresh the HTML report every X seconds. The value has to be between 1 and 60
seconds. The default is set to refresh the HTML report every 1 second.
.TP
\fB\-\-html-prefs=<JSON>
Set HTML report default preferences. Supply a valid JSON object containing the
HTML preferences. It allows the ability to customize each panel plot. See
example below.
.IP
.I Note:
The JSON object passed needs to be a one line JSON string. For instance,
.IP
.nf
\-\-html-prefs='{"theme":"bright","perPage":5,"layout":"horizontal","showTables":true,"visitors":{"plot":{"chartType":"bar"}}}'
.fi
.TP
\fB\-\-json-pretty-print
Format JSON output using tabs and newlines.
.IP
.I Note:
This is not recommended when outputting a real-time HTML report since the
WebSocket payload will much much larger.
.TP
\fB\-\-max-items=<number>
The maximum number of items to display per panel. The maximum can be a number
between 1 and n.
.IP
.I Note:
Only the CSV and JSON output allow a maximum number greater than the default
value of 366 (or 50 in the real-time HTML output) items per panel.
.TP
\fB\-\-no-color
Turn off colored output. This is the default output on terminals that do not
support colors.
.TP
\fB\-\-no-column-names
Don't write column names in the terminal output. By default, it displays column
names for each available metric in every panel.
.TP
\fB\-\-no-csv-summary
Disable summary metrics on the CSV output.
.TP
\fB\-\-no-progress
Disable progress metrics [total requests/requests per second].
.TP
\fB\-\-no-tab-scroll
Disable scrolling through panels when TAB is pressed or when a panel is
selected using a numeric key.
.TP
\fB\-\-no-html-last-updated
Do not show the last updated field displayed in the HTML generated report.
.TP
\fB\-\-no-parsing-spinner
Do now show the progress metrics and parsing spinner.
.SS
SERVER OPTIONS
.P
.I Note
This is just a WebSocket server to provide the raw real-time data.
It is not a WebServer itself. To access your reports html file, you will
still need your own HTTP server, place the generated report in it's document
root dir and open the html file in your browser. The browser will then open
another WebSocket-connection to the ws-server you may setup here,
to keep the dashboard up-to-date.
.TP
\fB\-\-addr
Specify IP address to bind the server to. Otherwise it binds to 0.0.0.0.
.IP
Usually there is no need to specify the address, unless you intentionally would
like to bind the server to a different address within your server.
.TP
\fB\-\-daemonize
Run GoAccess as daemon (only if \fB\-\-real-time-html enabled).
.IP
Note: It's important to make use of absolute paths across GoAccess'
configuration.
.TP
\fB\-\-user-name=<username>
Run GoAccess as the specified user.
.IP
Note: It's important to ensure the user or the users' group can access the
input and output files as well as any other files needed.
Other groups the user belongs to will be ignored.
As such it's advised to run GoAccess behind a SSL proxy as it's unlikely this
user can access the SSL certificates.
.TP
\fB\-\-origin=<url>
Ensure clients send the specified origin header upon the WebSocket handshake.
.TP
\fB\-\-pid-file=<path/goaccess.pid>
Write the daemon PID to a file when used along the --daemonize option.
.TP
\fB\-\-port=<port>
Specify the port to use. By default GoAccess' WebSocket server listens on port
7890.
.TP
\fB\-\-real-time-html
Enable real-time HTML output.
.IP
GoAccess uses its own WebSocket server to push the data from the server to the
client. See http://gwsocket.io for more details how the WebSocket server works.
.TP
\fB\-\-ws-url=<[scheme://]url[:port]>
URL to which the WebSocket server responds. This is the URL supplied to the
WebSocket constructor on the client side.
.IP
Optionally, it is possible to specify the WebSocket URI scheme, such as
.I ws://
or
.I wss://
for unencrypted and encrypted connections. e.g.,
.I
wss://goaccess.io
.IP
If GoAccess is running behind a proxy, you could set the client side to connect
to a different port by specifying the host followed by a colon and the port.
e.g.,
.I goaccess.io:9999
.IP
By default, it will attempt to connect to the generated report's hostname. If
GoAccess is running on a remote server, the host of the remote server should be
specified here. Also, make sure it is a valid host and NOT an http address.
.TP
\fB\-\-fifo-in=<path/file>
Creates a named pipe (FIFO) that reads from on the given path/file.
.TP
\fB\-\-fifo-out=<path/file>
Creates a named pipe (FIFO) that writes to the given path/file.
.TP
\fB\-\-ssl-cert=<cert.crt>
Path to TLS/SSL certificate. In order to enable TLS/SSL support, GoAccess
requires that \-\-ssl-cert and \-\-ssl-key are used.

Only if configured using --with-openssl
.TP
\fB\-\-ssl-key=<priv.key>
Path to TLS/SSL private key. In order to enable TLS/SSL support, GoAccess
requires that \-\-ssl-cert and \-\-ssl-key are used.

Only if configured using --with-openssl
.SS
FILE OPTIONS
.TP
\fB\-
The log file to parse is read from stdin.
.TP
\fB\-f \-\-log-file=<logfile>
Specify the path to the input log file. If set in the config file, it will take
priority over -f from the command line.
.TP
\fB\-S \-\-log-size=<bytes>
Specify the log size in bytes. This is useful when piping in logs for
processing in which the log size can be explicitly set.
.TP
\fB\-l \-\-debug-file=<debugfile>
Send all debug messages to the specified file.
.TP
\fB\-p \-\-config-file=<configfile>
Specify a custom configuration file to use. If set, it will take priority over
the global configuration file (if any).
.TP
\fB\-\-invalid-requests=<filename>
Log invalid requests to the specified file.
.TP
\fB\-\-unknowns-log=<filename>
Log unknown browsers and OSs to the specified file.
.TP
\fB\-\-no-global-config
Do not load the global configuration file. This directory should normally be
/usr/local/etc, unless specified with
.I --sysconfdir=/dir.
See --dcf option for finding the default configuration file.
.SS
PARSE OPTIONS
.TP
\fB\-a \-\-agent-list
Enable a list of user-agents by host. For faster parsing, do not enable this
flag.
.TP
\fB\-d \-\-with-output-resolver
Enable IP resolver on HTML|JSON output.
.TP
\fB\-e \-\-exclude-ip=<IP|IP-range>
Exclude an IPv4 or IPv6 from being counted.
Ranges can be included as well using a dash in between the IPs (start-end).
.IP
.I Examples:
  exclude-ip 127.0.0.1
  exclude-ip 192.168.0.1-192.168.0.100
  exclude-ip ::1
  exclude-ip 0:0:0:0:0:ffff:808:804-0:0:0:0:0:ffff:808:808
.TP
\fB\-H \-\-http-protocol=<yes|no>
Set/unset HTTP request protocol. This will create a request key containing the
request protocol + the actual request.
.TP
\fB\-M \-\-http-method=<yes|no>
Set/unset HTTP request method. This will create a request key containing the
request method + the actual request.
.TP
\fB\-o \-\-output=<path/file.[json|csv|html]>
Write output to stdout given one of the following files and the corresponding
extension for the output format:
.IP
  /path/file.csv - Comma-separated values (CSV)
  /path/file.json - JSON (JavaScript Object Notation)
  /path/file.html - HTML
.TP
\fB\-q \-\-no-query-string
Ignore request's query string. i.e., www.google.com/page.htm?query =>
www.google.com/page.htm.
.IP
.I Note:
Removing the query string can greatly decrease memory consumption, especially
on timestamped requests.
.TP
\fB\-r \-\-no-term-resolver
Disable IP resolver on terminal output.
.TP
\fB\-\-444-as-404
Treat non-standard status code 444 as 404.
.TP
\fB\-\-4xx-to-unique-count
Add 4xx client errors to the unique visitors count.
.TP
\fB\-\-anonymize-ip
Anonymize the client IP address. The IP anonymization option sets the last
octet of IPv4 user IP addresses and the last 80 bits of IPv6 addresses to
zeros.
e.g., 192.168.20.100 => 192.168.20.0
e.g., 2a03:2880:2110:df07:face:b00c::1 => 2a03:2880:2110:df07::
.TP
\fB\-\-all-static-files
Include static files that contain a query string. e.g.,
/fonts/fontawesome-webfont.woff?v=4.0.3
.TP
\fB\-\-browsers-file=<path>
By default GoAccess parses an "essential/basic" curated list of browsers &
crawlers. If you need to add additional browsers, use this option.
Include an additional delimited list of browsers/crawlers/feeds etc.
See config/browsers.list for an example or
https://raw.githubusercontent.com/allinurl/goaccess/master/config/browsers.list
.TP
\fB\-\-date-spec=<date|hr>
Set the date specificity to either date (default) or hr to display hours
appended to the date.
.IP
This is used in the visitors panel. It's useful for tracking visitors at the
hour level. For instance, an hour specificity would yield to display traffic as
18/Dec/2010:19
.TP
\fB\-\-double-decode
Decode double-encoded values. This includes, user-agent, request, and referrer.
.TP
\fB\-\-enable-panel=<PANEL>
Enable parsing and displaying the given panel.
.IP
.I Available panels:
  VISITORS
  REQUESTS
  REQUESTS_STATIC
  NOT_FOUND
  HOSTS
  OS
  BROWSERS
  VISIT_TIMES
  VIRTUAL_HOSTS
  REFERRERS
  REFERRING_SITES
  KEYPHRASES
  STATUS_CODES
  REMOTE_USER
  CACHE_STATUS
  GEO_LOCATION
  MIME_TYPE
  TLS_TYPE
.TP
\fB\-\-hide-referrer=<NEEDLE>
Hide a referrer but still count it. Wild cards are allowed in the needle. i.e.,
*.bing.com.
.TP
\fB\-\-hour-spec=<hr|min>
Set the time specificity to either hour (default) or min to display the tenth
of an hour appended to the hour.
.IP
This is used in the time distribution panel. It's useful for tracking peaks of
traffic on your server at specific times.
.TP
\fB\-\-ignore-crawlers
Ignore crawlers from being counted.
.TP
\fB\-\-ignore-panel=<PANEL>
Ignore parsing and displaying the given panel.
.IP
.I Available panels:
  VISITORS
  REQUESTS
  REQUESTS_STATIC
  NOT_FOUND
  HOSTS
  OS
  BROWSERS
  VISIT_TIMES
  VIRTUAL_HOSTS
  REFERRERS
  REFERRING_SITES
  KEYPHRASES
  STATUS_CODES
  REMOTE_USER
  CACHE_STATUS
  GEO_LOCATION
  MIME_TYPE
  TLS_TYPE
.TP
\fB\-\-ignore-referrer=<referrer>
Ignore referers from being counted. Wildcards allowed. e.g.,
.I
*.domain.com
.I
ww?.domain.*
.TP
\fB\-\-ignore-statics=<req|panel>
Ignore static file requests.

.I req
  Only ignore request from valid requests

.I panels
  Ignore request from panels.

  Note that it will count them towards the total number of requests
.TP
\fB\-\-ignore-status=<CODE>
Ignore parsing and displaying one or multiple status code(s). For multiple
status codes, use this option multiple times.
.TP
\fB\-\-keep-last=<num_days>
Keep the last specified number of days in storage. This will recycle the storage tables. e.g., keep & show only the last 7 days.
.TP
\fB\-\-no-ip-validation
Disable client IP validation. Useful if IP addresses have been obfuscated before
being logged.
The log still needs to contain a placeholder for
.I %h
usually it's a resolved IP. e.g.
.I ord37s19-in-f14.1e100.net.
.TP
\fB\-\-no-strict-status
Disable HTTP status code validation. Some servers would record this value only
if a connection was established to the target and the target sent a response.
Otherwise, it could be recorded as -.
.TP
\fB\-\-num-tests=<number>
Number of lines from the access log to test against the provided log/date/time
format. By default, the parser is set to test 10 lines. If set to 0, the parser
won't test any lines and will parse the whole access log. If a line matches the
given log/date/time format before it reaches
.I <number>,
the parser will consider the log to be valid, otherwise GoAccess will return
EXIT_FAILURE and display the relevant error messages.
.TP
\fB\-\-process-and-exit
Parse log and exit without outputting data. Useful if we are looking to only
add new data to the on-disk database without outputting to a file or a
terminal.
.TP
\fB\-\-real-os
Display real OS names. e.g, Windows XP, Snow Leopard.
.TP
\fB\-\-sort-panel=<PANEL,FIELD,ORDER>
Sort panel on initial load. Sort options are separated by comma. Options are in
the form: PANEL,METRIC,ORDER
.IP
.I Available metrics:
  BY_HITS     - Sort by hits
  BY_VISITORS - Sort by unique visitors
  BY_DATA     - Sort by data
  BY_BW       - Sort by bandwidth
  BY_AVGTS    - Sort by average time served
  BY_CUMTS    - Sort by cumulative time served
  BY_MAXTS    - Sort by maximum time served
  BY_PROT     - Sort by http protocol
  BY_MTHD     - Sort by http method
.IP
.I Available orders:
  ASC
  DESC
.TP
\fB\-\-static-file=<extension>
Add static file extension. e.g.:
.I .mp3
Extensions are case sensitive.
.SS
GEOLOCATION OPTIONS
.TP
\fB\-g \-\-std-geoip
Standard GeoIP database for less memory usage.
.TP
\fB\-\-geoip-database=<geofile>
Specify path to GeoIP database file. i.e., GeoLiteCity.dat.

If using GeoIP2, you will need to download the GeoLite2 City or Country
database from MaxMind.com and use the option --geoip-database to specify the
database. You can also get updated database files for GeoIP legacy, you can
find these as GeoLite Legacy Databases from MaxMind.com. IPv4 and IPv6 files
are supported as well. For updated DB URLs, please see the default GoAccess
configuration file.

.I Note:
--geoip-city-data is an alias of --geoip-database.
.SS
OTHER OPTIONS
.TP
\fB\-h \-\-help
The help.
.TP
\fB\-s \-\-storage
Display current storage method. i.e., B+ Tree, Hash.
.TP
\fB\-V \-\-version
Display version information and exit.
.TP
\fB\-\-dcf
Display the path of the default config file when `-p` is not used.
.SS
PERSISTENCE STORAGE OPTIONS
.TP
\fB\-\-persist
Persist parsed data into disk. If database files exist, files will be
overwritten. This should be set to the first dataset. See examples below.
.TP
\fB\-\-restore
Load previously stored data from disk. If reading persisted data only, the
database files need to exist. See
.I --persist
and examples below.
.TP
\fB\-\-db-path=<dir>
Path where the on-disk database files are stored. The default value is the
.I /tmp
directory.

.SH CUSTOM LOG/DATE FORMAT
GoAccess can parse virtually any web log format.
.P
Predefined options include, Common Log Format (CLF), Combined Log Format
(XLF/ELF), including virtual host, Amazon CloudFront (Download Distribution),
Google Cloud Storage and W3C format (IIS).
.P
GoAccess allows any custom format string as well.
.P
There are two ways to configure the log format.
The easiest is to run GoAccess with
.I -c
to prompt a configuration window. Otherwise, it can be configured under
~/.goaccessrc or the %sysconfdir%.
.IP "time-format"
The
.I time-format
variable followed by a space, specifies the log format time
containing any combination of regular characters and special format specifiers.
They all begin with a percentage (%) sign. See `man strftime`.
.I %T or %H:%M:%S.
.IP
.I Note:
If a timestamp is given in microseconds,
.I
%f
must be used as
.I
time-format
or
.I
%*
if the timestamp is given in milliseconds.
.IP "date-format"
The
.I date-format
variable followed by a space, specifies the log format date containing any
combination of regular characters and special format specifiers. They all begin
with a percentage (%) sign. See `man strftime`. e.g.,
.I %Y-%m-%d.
.IP
.I Note:
If a timestamp is given in microseconds,
.I
%f
must be used as
.I
date-format
or
.I
%*
if the timestamp is given in milliseconds.
.IP "log-format"
The
.I log-format
variable followed by a space or
.I \\\\t
, specifies the log format string.
.IP %x
A date and time field matching the
.I time-format
and
.I date-format
variables. This is used when given a timestamp or the date & time are
concatenated as a single string (e.g., 1501647332 or 20170801235000) instead of
the date and time being in two separated variables.
.IP %t
time field matching the
.I time-format
variable.
.IP %d
date field matching the
.I date-format
variable.
.IP %v
The canonical Server Name of the server serving the request (Virtual Host).
.IP %e
This is the userid of the person requesting the document as determined by HTTP
authentication.
.IP %C
The cache status of the object the server served.
.IP %h
host (the client IP address, either IPv4 or IPv6)
.IP %r
The request line from the client. This requires specific delimiters around the
request (as single quotes, double quotes, or anything else) to be parsable. If
not, we have to use a combination of special format specifiers as %m %U %H.
.IP %q
The query string.
.IP %m
The request method.
.IP %U
The URL path requested.

.I Note:
If the query string is in %U, there is no need to use
.I %q.
However, if the URL path, does not include any query string, you may use
.I %q
and the query string will be appended to the request.
.IP %H
The request protocol.
.IP %s
The status code that the server sends back to the client.
.IP %b
The size of the object returned to the client.
.IP %R
The "Referrer" HTTP request header.
.IP %u
The user-agent HTTP request header.
.IP %K
The TLS encryption settings chosen for the connection. (In Apache LogFormat: %{SSL_PROTOCOL}x)
.IP %k
The TLS encryption settings chosen for the connection. (In Apache LogFormat: %{SSL_CIPHER}x)
.IP %M
The MIME-type of the requested resource. (In Apache LogFormat: %{Content-Type}o)
.IP %D
The time taken to serve the request, in microseconds as a decimal number.
.IP %T
The time taken to serve the request, in seconds with milliseconds resolution.
.IP %L
The time taken to serve the request, in milliseconds as a decimal number.
.IP %^
Ignore this field.
.IP %~
Move forward through the log string until a non-space (!isspace) char is found.
.IP ~h
The host (the client IP address, either IPv4 or IPv6) in a X-Forwarded-For (XFF) field.

It uses a special specifier which consists of a tilde before the host
specifier, followed by the character(s) that delimit the XFF field, which are
enclosed by curly braces (i.e., ~h{," })

For example, ~h{," } is used in order to parse "11.25.11.53, 17.68.33.17" field
which is delimited by a double quote, a comma, and a space.
.P
.I Note:
In order to get the average, cumulative and maximum time served in GoAccess,
you will need to start logging response times in your web server. In Nginx you
can add
.I $request_time
to your log format, or
.I %D
in Apache.
.P
.I Important:
If multiple time served specifiers are used at the same time, the first option
specified in the format string will take priority over the other specifiers.
.P
GoAccess
.I requires
the following fields:
.IP
.I %h
a valid IPv4/6
.IP
.I %d
a valid date
.IP
.I %r
the request
.SH INTERACTIVE MENU
.IP "F1 or h"
Main help.
.IP "F5"
Redraw main window.
.IP "q"
Quit the program, current window or collapse active module
.IP "o or ENTER"
Expand selected module or open window
.IP "0-9 and Shift + 0"
Set selected module to active
.IP "j"
Scroll down within expanded module
.IP "k"
Scroll up within expanded module
.IP "c"
Set or change scheme color.
.IP "TAB"
Forward iteration of modules. Starts from current active module.
.IP "SHIFT + TAB"
Backward iteration of modules. Starts from current active module.
.IP "^f"
Scroll forward one screen within an active module.
.IP "^b"
Scroll backward one screen within an active module.
.IP "s"
Sort options for active module
.IP "/"
Search across all modules (regex allowed)
.IP "n"
Find the position of the next occurrence across all modules.
.IP "g"
Move to the first item or top of screen.
.IP "G"
Move to the last item or bottom of screen.
.SH EXAMPLES
.I Note:
Piping data into GoAccess won't prompt a log/date/time configuration dialog,
you will need to previously define it in your configuration file or in the
command line.

.SS
DIFFERENT OUTPUTS
.P
To output to a terminal and generate an interactive report:
.IP
# goaccess access.log
.P
To generate an HTML report:
.IP
# goaccess access.log -a -o report.html
.P
To generate a JSON report:
.IP
# goaccess access.log -a -d -o report.json
.P
To generate a CSV file:
.IP
# goaccess access.log --no-csv-summary -o report.csv
.P
GoAccess also allows great flexibility for real-time filtering and parsing. For
instance, to quickly diagnose issues by monitoring logs since goaccess was
started:
.IP
# tail -f access.log | goaccess -
.P
And even better, to filter while maintaining opened a pipe to preserve
real-time analysis, we can make use of
.I tail -f
and
a matching pattern tool such as
.I grep, awk, sed,
etc:
.IP
# tail -f access.log | grep -i --line-buffered 'firefox' | goaccess --log-format=COMBINED -
.P
or to parse from the beginning of the file while maintaining the pipe opened
and applying a filter
.IP
# tail -f -n +0 access.log | grep -i --line-buffered 'firefox' | goaccess --log-format=COMBINED -o report.html --real-time-html -
.SS
MULTIPLE LOG FILES
.P
There are several ways to parse multiple logs with GoAccess. The simplest is to
pass multiple log files to the command line:
.IP
# goaccess access.log access.log.1
.P
It's even possible to parse files from a pipe while reading regular files:
.IP
# cat access.log.2 | goaccess access.log access.log.1 -
.P
.I Note
that the single dash is appended to the command line to let GoAccess know that
it should read from the pipe.
.P
Now if we want to add more flexibility to GoAccess, we can do a series of
pipes. For instance, if we would like to process all compressed log files
.I access.log.*.gz
in addition to the current log file, we can do:
.IP
# zcat access.log.*.gz | goaccess access.log -
.P
.I Note:
On Mac OS X, use gunzip -c instead of zcat.
.SS
REAL TIME HTML OUTPUT
.P
GoAccess has the ability to output real-time data in the HTML report. You can
even email the HTML file since it is composed of a single file with no external
file dependencies, how neat is that!
.P
The process of generating a real-time HTML report is very similar to the
process of creating a static report. Only --real-time-html is needed to make it
real-time.
.IP
# goaccess access.log -o /usr/share/nginx/html/site/report.html --real-time-html
.P
By default, GoAccess will use the host name of the generated report.
Optionally, you can specify the URL to which the client's browser will connect
to. See https://goaccess.io/faq for a more detailed example.
.IP
# goaccess access.log -o report.html --real-time-html --ws-url=goaccess.io
.P
By default, GoAccess listens on port 7890, to use a different port other than
7890, you can specify it as (make sure the port is opened):
.IP
# goaccess access.log -o report.html --real-time-html --port=9870
.P
And to bind the WebSocket server to a different address other than 0.0.0.0, you
can specify it as:
.IP
# goaccess access.log -o report.html --real-time-html --addr=127.0.0.1
.P
.I Note:
To output real time data over a TLS/SSL connection, you need to use
.I --ssl-cert=<cert.crt>
and
.I --ssl-key=<priv.key>.
.SS
WORKING WITH DATES
.P
Another useful pipe would be filtering dates out of the web log
.P
The following will get all HTTP requests starting on 05/Dec/2010 until the end
of the file.
.IP
# sed -n '/05\/Dec\/2010/,$ p' access.log | goaccess -a -
.P
or using relative dates such as yesterdays or tomorrows day:
.IP
# sed -n '/'$(date '+%d\/%b\/%Y' -d '1 week ago')'/,$ p' access.log | goaccess -a -
.P
If we want to parse only a certain time-frame from DATE a to DATE b, we can do:
.IP
# sed -n '/5\/Nov\/2010/,/5\/Dec\/2010/ p' access.log | goaccess -a -
.P
If we want to preserve only certain amount of data and recycle storage, we can
keep only a certain number of days. For instance to keep & show the last 5
days:
.IP
# goaccess access.log --keep-last=5
.SS
VIRTUAL HOSTS
.P
Assuming your log contains the virtual host (server blocks) field. For
instance:
.IP
vhost.com:80 10.131.40.139 - - [02/Mar/2016:08:14:04 -0600] "GET /shop/bag-p-20
HTTP/1.1" 200 6715 "-" "Apache (internal dummy connection)"
.P
And you would like to append the virtual host to the request in order to see
which virtual host the top urls belong to
.IP
awk '$8=$1$8' access.log | goaccess -a -
.P
To exclude a list of virtual hosts you can do the following:
.IP
# grep -v "`cat exclude_vhost_list_file`" vhost_access.log | goaccess -
.SS
FILES & STATUS CODES
.P
To parse specific pages, e.g., page views, html, htm, php, etc. within a
request:
.IP
# awk '$7~/\.html|\.htm|\.php/' access.log | goaccess -
.P
Note,
.I $7
is the request field for the common and combined log format, (without Virtual
Host), if your log includes Virtual Host, then you probably want to use
.I $8
instead. It's best to check which field you are shooting for, e.g.:
.IP
# tail -10 access.log | awk '{print $8}'
.P
Or to parse a specific status code, e.g., 500 (Internal Server Error):
.IP
# awk '$9~/500/' access.log | goaccess -
.SS
SERVER
.P
Also, it is worth pointing out that if we want to run GoAccess at lower
priority, we can run it as:
.IP
# nice -n 19 goaccess -f access.log -a
.P
and if you don't want to install it on your server, you can still run it from
your local machine:
.IP
# ssh -n root@server 'tail -f /var/log/apache2/access.log' | goaccess -
.P
Note: SSH requires
.I -n
so GoAccess can read from stdin. Also, make sure to use SSH keys for
authentication as it won't work if a passphrase is required.
.SS
INCREMENTAL LOG PROCESSING
.P
GoAccess has the ability to process logs incrementally through its internal
storage and dump its data to disk. It works in the following way:

.nr step 1 1
.IP \n[step] 3
A dataset must be persisted first with
.I --persist,
then the same dataset can be loaded with
.IP \n+[step]
.I --restore.
If new data is passed (piped or through a log file), it will append it to the
original dataset.

.P
NOTES

GoAccess keeps track of inodes of all the files processed (assuming files will
stay on the same partition), in addition, it extracts a snippet of data from
the log along with the last line parsed of each file and the timestamp of the
last line parsed. e.g.,
inode:29627417|line:20012|ts:20171231235059

First it compares if the snippet matches the log being parsed, if it does, it
assumes the log hasn't changed dramatically, e.g., hasn't been truncated. If
the inode does not match the current file, it parses all lines. If the current
file matches the inode, it then reads the remaining lines and updates the count
of lines parsed and the timestamp. As an extra precaution, it won't parse log
lines with a timestamp ≤ than the one stored.

Piped data works based off the timestamp of the last line read. For instance,
it will parse and discard all incoming entries until it finds a timestamp >=
than the one stored.

.P
For instance:
.IP
// last month access log
.br
# goaccess access.log.1 --persist
.P
then, load it with
.IP
// append this month access log, and preserve new data
.br
# goaccess access.log --restore --persist
.P
To read persisted data only (without parsing new data)
.IP
# goaccess --restore
.P
.SH NOTES
Each active panel has a total of 366 items or 50 in the real-time HTML report.
The number of items is customizable using
.I max-items
Note that HTML, CSV and JSON output allow a maximum number greater than the
default value of 366 items per panel.
.P
A hit is a request (line in the access log), e.g., 10 requests = 10 hits. HTTP
requests with the same IP, date, and user agent are considered a unique visit.
.SH BUGS
If you think you have found a bug, please send me an email to
.I goaccess@prosoftcorp.com
or use the issue tracker in https://github.com/allinurl/goaccess/issues
.SH AUTHOR
Gerardo Orellana <hello@goaccess.io>
For more details about it, or new releases, please visit
https://goaccess.io