Custom Log Format

Andrew Caudwell edited this page Jul 24, 2017 · 6 revisions

Use Gource to visualize other data sources via the custom log format option


If you want to use Gource to visualize something other than the supported log formats, there is a pipe ('|') delimited custom log format option:

  • timestamp - A unix timestamp of when the update occured.
  • username - The name of the user who made the update.
  • type - initial for the update type - (A)dded, (M)odified or (D)eleted.
  • file - Path of the file updated.
  • colour - A colour for the file in hex (FFFFFF) format. Optional.

This format is detected by Gource, so you don't need any extra command line options to use it:

gource custom.log

Custom Log Example

The user andrew adding the file src/main.cpp:


Adding the same file coloured red (FF0000):


Streaming Custom Log Format via STDIN

If you want to stream live data into Gource, a good way to do this is to make a script that feeds custom log format entries into Gource via STDIN: | gource --realtime --log-format custom -

Assuming '' periodically prints custom log format lines to STDOUT. The '-' at the end of the Gource command tells it to expect data on STDIN.

--realtime tells Gource to increment the clock in real time.

NOTE: This examples assumes Gource 0.27 or later (STDIN support was buggy in earlier versions).

Custom Log Scripts


A script to visualize the activity of the Arch Linux package manager, pacman:


Martin contributes this query to generate a Gource custom log from a Bugzilla database:

                CONCAT(date_changed, '|', login_name, '|', x, '|', description),
        ' ', '_')
                UNIX_TIMESTAMP(a.bug_when) AS date_changed,
                p.login_name AS login_name,
                        WHEN (CHAR_LENGTH(added) > 0 AND CHAR_LENGTH(removed) = 0) THEN 'A'
                        WHEN (CHAR_LENGTH(added) = 0 AND CHAR_LENGTH(removed) > 0)THEN 'D'
                        WHEN (CHAR_LENGTH(added) > 0 AND CHAR_LENGTH(removed) > 0) THEN 'M'
                END AS x,
                CONCAT(, '/',, '/',, '/', b.bug_id, ' - ', b.short_desc) AS description
                bugs_activity a
                LEFT JOIN
                profiles p
                        ON a.who = p.userid
                LEFT JOIN
                bugs b
                        ON a.bug_id = b.bug_id
                LEFT JOIN
                products pr
                        ON b.product_id =
                LEFT JOIN
                components c
                        ON b.component_id =
                LEFT JOIN
                classifications cl
                        ON pr.classification_id =
        ORDER BY a.bug_when ASC


WolverineX02 has created a script to display DokuWiki change history with Gource which you can get here:


Gource doesn't include any built in support for Perforce currently. Olaf has created this one shell one liner to convert Perforce logs to Gource custom log format:

p4 changes ...|awk '{print $2}'|p4 -x - describe -s|awk '(/^Change / || /^... /) {if ($1 == "Change") {u=substr($4,1,index($4,"@")-1); t = $(NF-1) " " $NF; gsub("/"," ",t); gsub(":"," ",t);time=mktime(t);} else {if ($NF=="add") {c="A";} else if ($NF=="delete") {c="D";} else {c="M";};f=substr($2,3,index($2,"#")-3);print time "|" u "|" c "|" f;}}'|sort -n


Kai has written a script that convert a Fossil timeline to custom log format:


macbre has written a script that convert a MediaWiki edits history to custom log format:


Andrei Rybak has written a script to convert a JIRA tickets history to custom log format:

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.