Goaccess: How to run two or more real-time-html instances of GoAccess

Created on 16 Jan 2017  路  9Comments  路  Source: allinurl/goaccess

Hello. When I run these codes , it runs with no error but it isnt refreshing new coming logs.
What is the problem with my config?
First:

/usr/local/bin/goaccess -f /data/goaccess/log.1 -o /var/www/html/log1.html --real-time-html --ws-url=192.168.1.2 --port=9926

Second:

/usr/local/bin/goaccess -f /data/goaccess/log.2 -o /var/www/html/log2.html --real-time-html --ws-url=192.168.1.2 --port=9927
documentation html report question websocket-server

Most helpful comment

To run multiple instances, you need to ensure the following:

  1. Run each instance on a different port --port.
  2. Different pipes (FIFOs) --fifo-in=/path/in.1 --fifo-out=/path/out.1.
  3. (Optionally) IFF you are using the on-disk storage, then you will need different path where the DB files are stored --db-path=/path/instance1/.

Examples:

goaccess /prod/access.log -o /var/www/html/prod.html --real-time-html --ws-url=192.168.1.2 --port=7890 --fifo-in=/tmp/prod.in --fifo-out=/tmp/prod.out

AND

goaccess /dev/access.log -o /var/www/html/dev.html --real-time-html --ws-url=192.168.1.2 --port=7891 --fifo-in=/tmp/dev.in --fifo-out=/tmp/dev.out

Note:

Issue #575 reported that --fifo-out and --fifo-in options were not taking the new params. It has been fixed.

All 9 comments

To run multiple instances, you need to ensure the following:

  1. Run each instance on a different port --port.
  2. Different pipes (FIFOs) --fifo-in=/path/in.1 --fifo-out=/path/out.1.
  3. (Optionally) IFF you are using the on-disk storage, then you will need different path where the DB files are stored --db-path=/path/instance1/.

Examples:

goaccess /prod/access.log -o /var/www/html/prod.html --real-time-html --ws-url=192.168.1.2 --port=7890 --fifo-in=/tmp/prod.in --fifo-out=/tmp/prod.out

AND

goaccess /dev/access.log -o /var/www/html/dev.html --real-time-html --ws-url=192.168.1.2 --port=7891 --fifo-in=/tmp/dev.in --fifo-out=/tmp/dev.out

Note:

Issue #575 reported that --fifo-out and --fifo-in options were not taking the new params. It has been fixed.

Hello,

Thank you for your help. What do you mean by "options were not taking new parameters"? Is "--port=" new parameter? On last stable version,I run above commands and it didn't give any error but generated dev.html, it created prod.in and prod.out files with 0 bytes also not refreshing with new coming logs.

I will build development version and try. And get back to you.

I also run below command;

/usr/local/bin/goaccess -f /data/goaccess/log.1 -o /var/www/html/log1.html --ws-url=192.168.1.2 --port=7891 --html-report-title=Goaccess --ignore-panel=NOT_FOUND --ignore-panel=OS --ignore-panel=REFERRING_SITES --ignore-panel=STATUS_CODES

I build from dev version of goaccess and managed to run 2 real time html. Thank you for your support.

Glad that worked. Stay tuned for the upcoming version.

I'm able to run real-time for both of my sites individually, but when I try doing them at the same time using the instructions above, the second one just hangs at 'Parsing. . . [0] [0/s]'. CTRL+C won't stop the process either.

Here are my commands:
zcat -f /var/log/apache2/www.site1.access.log.*.gz | goaccess /var/log/apache2/www.site1.access.log -a -d -o /var/www/html/site1.html --real-time-html --ignore-crawlers --ws-url=192.168.0.3 --port=7890 --fifo-in=/tmp/site1.in --fifo-out=/tmp/site1.out

zcat -f /var/log/apache2/www.site2.access.log.*.gz | goaccess /var/log/apache2/www.site2.access.log -a -d -o /var/www/html/site2.html --real-time-html --ignore-crawlers --ws-url=192.168.0.3 --port=7891 --fifo-in=/tmp/site2.in --fifo-out=/tmp/site2.out

@SeaMonkey82 I'm guessing you are using the on-disk storage. You will need different path where the DB files are stored --db-path=/path/instance1/.

@SeaMonkey82 I'm guessing you are using the on-disk storage.

Nope. Neither in the commands nor the conf file.

Had same issue while running goaccess (not even --real-time-html, just one-off htmls). Seems that it's indeed using on-disk storage, but that's the default (at least in Ubuntu?), so it's not obvious :)
Fixed by generating unique tmp dir in the wrapper script and passing to --db-path

@karlicoss Thanks for sharing that. I'm very close to release the replacement for TC, so hopes this will be easier.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

narayan1599 picture narayan1599  路  3Comments

DestinyWang picture DestinyWang  路  3Comments

SergioDG-YCC picture SergioDG-YCC  路  3Comments

tbarbette picture tbarbette  路  3Comments

deosha picture deosha  路  3Comments