Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure html output to hide specific table columns for given chart #1696

Open
clusin opened this issue Mar 7, 2020 · 3 comments
Open

Configure html output to hide specific table columns for given chart #1696

clusin opened this issue Mar 7, 2020 · 3 comments

Comments

@clusin
Copy link

@clusin clusin commented Mar 7, 2020

Hi,

Is it possible to leverage the html-prefs configuration option some way to hide specific table columns by default in the generated report?

I was digging around a bit in the HTML and it looks like there's a hide attribute somewhere in the page's generated prefs structure. But I wasn't sure how to go about setting it via configuration or if it's possible.

Is this supported?

@allinurl

This comment has been minimized.

Copy link
Owner

@allinurl allinurl commented Mar 7, 2020

Great question, you can certainly do that. Easiest way to determine which flags you can set is to actually set them in the report and then looking at your inspector tools > application > localStorage e.g.,

{
    "autoHideTables": true,
    "layout": "horizontal",
    "perPage": 7,
    "theme": "darkPurple",
    "visitors": {
        "columns": {
            "bytes": {
                "hide": true
            }
        }
    },
    "requests": {
        "columns": {
            "bytes": {
                "hide": true
            },
            "avgts": {
                "hide": true
            },
            "visitors": {
                "hide": true
            }
        }
    }
}
@clusin

This comment has been minimized.

Copy link
Author

@clusin clusin commented Mar 7, 2020

Awesome thank you Gerardo. It feels like I'm hitting some sort of line length limit for the config file. I tried configuring the panel to my liking and then copy-pasting the json blob from local storage to my configuration file and it displays error:

Fatal error has occurred
Error occured at: src/settings.c - parse_conf_file - 281
Malformed config key at line: 6

It seems to be failing between 400-500 character wide config line. I can reorder the json dictionary entries and they seem to parse fine, but there's a line length limit of

I'm already thinking about compiling from source for the MaxMind GeoIPV2 support. Could compiling with getline support be a potential workaround or is it separate functions for parsing of logging and config?

For reference my config looks like:

html-prefs {"theme":"bright","perPage":10,"layout":"horizontal","autoHideTables":true,"hosts":{"columns":{"avgts":{"hide":true},"cumts":{"hide":true},"maxts":{"hide":true},"data":{"hide":true}}},"visit_time":{"plot":{"chartType":"area-spline"}},"requests":{"columns":{"cumts":{"hide":true}}},"visitors":{"plot":{"chartType":"bar"},"columns":{"cumts":{"hide":true}}},"not_found":{"columns":{"cumts":{"hide":true}}},"static_requests":{"columns":{"cumts":{"hide":true}}},"os":{"columns":{"cumts":{"hide":true},"maxts":{"hide":true},"avgts":{"hide":true}}},"vhosts":{"columns":{"avgts":{"hide":true},"cumts":{"hide":true},"maxts":{"hide":true}}},"browsers":{"columns":{"avgts":{"hide":true},"cumts":{"hide":true},"maxts":{"hide":true}}},"referring_sites":{"columns":{"avgts":{"hide":true},"cumts":{"hide":true},"maxts":{"hide":true},"bytes":{"hide":true}}},"referrers":{"columns":{"maxts":{"hide":true},"cumts":{"hide":true},"avgts":{"hide":true},"bytes":{"hide":true}}},"keyphrases":{"columns":{"bytes":{"hide":true},"avgts":{"hide":true},"cumts":{"hide":true},"maxts":{"hide":true}}},"status_codes":{"columns":{"cumts":{"hide":true}}},"geolocation":{"columns":{"bytes":{"hide":true},"avgts":{"hide":true},"cumts":{"hide":true},"maxts":{"hide":true}}}}
@allinurl

This comment has been minimized.

Copy link
Owner

@allinurl allinurl commented Mar 8, 2020

Dan, thanks for reporting that, yes, I believe the limit is set to 512. I can increase that limit for the upcoming version. getline(3) works only when parsing the log entries. However, a workaround is to try passing it as a command line option. e.g.,

goaccess access.log -o rep.html --log-format=COMBINED --html-prefs='{"theme":"bright","perPage":10,"layout":"horizontal","autoHideTables":true,"hosts":{"columns":{"avgts":{"hide":true},"cumts":{"hide":true},"maxts":{"hide":true},"data":{"hide":true}}},"visit_time":{"plot":{"chartType":"area-spline"}},"requests":{"columns":{"cumts":{"hide":true}}},"visitors":{"plot":{"chartType":"bar"},"columns":{"cumts":{"hide":true}}},"not_found":{"columns":{"cumts":{"hide":true}}},"static_requests":{"columns":{"cumts":{"hide":true}}},"os":{"columns":{"cumts":{"hide":true},"maxts":{"hide":true},"avgts":{"hide":true}}},"vhosts":{"columns":{"avgts":{"hide":true},"cumts":{"hide":true},"maxts":{"hide":true}}},"browsers":{"columns":{"avgts":{"hide":true},"cumts":{"hide":true},"maxts":{"hide":true}}},"referring_sites":{"columns":{"avgts":{"hide":true},"cumts":{"hide":true},"maxts":{"hide":true},"bytes":{"hide":true}}},"referrers":{"columns":{"maxts":{"hide":true},"cumts":{"hide":true},"avgts":{"hide":true},"bytes":{"hide":true}}},"keyphrases":{"columns":{"bytes":{"hide":true},"avgts":{"hide":true},"cumts":{"hide":true},"maxts":{"hide":true}}},"status_codes":{"columns":{"cumts":{"hide":true}}},"geolocation":{"columns":{"bytes":{"hide":true},"avgts":{"hide":true},"cumts":{"hide":true},"maxts":{"hide":true}}}}'
@allinurl allinurl added the change label Mar 8, 2020
@allinurl allinurl added this to the GoAccess 1.4 milestone Mar 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.