How to get Count of Unique Users Accessing Jira
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Solution
Access Logs
By default Jira will ship with Tomcat's access log valve enabled. This is set within server.xml
:
1
<Valve className="org.apache.catalina.valves.AccessLogValve" pattern="%a %{jira.request.id}r %{jira.request.username}r %t "%m %U%q %H" %s %b %D "%{Referer}i" "%{User-Agent}i" "%{jira.request.assession.id}r""/>
Here is an example of an user access Jira's dashboard:
1
0:0:0:0:0:0:0:1 673x575x1 admin [15/Mar/2019:11:13:32 -0700] "GET /secure/RapidBoard.jspa?rapidView=3&useStoredSettings=true HTTP/1.1" 200 12078 121 "http://localhost:8080/secure/Dashboard.jspa" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36" "hehlph"
Here we can see that the "admin" user had accessed an Agile board in Jira on 15/Mar/2019
There's a lot more information to grab here, but we'll only focus on the users here.
Unique users per day
With the details above from the access logs, here is an example of how it can be parsed to determine how many unique users are accessing Jira per day:
1
2
3
4
5
6
7
$ awk '{print $3}' access_log.2019-03-14 | sort | uniq
-
admin
testuser
dchan
joeblack
scrooge
Note that the "-" is an anonymous user. This could be an user access Jira for the first time and has not yet logged in. Or even Jira making a call to itself for some additional resources for a previous page load request.
If you want to extend the time range, simply include log files for each extra day.
Note that in a Jira Data Center environment, each node will have it's own set access logs. So we would need to check each node to get accurate data on unique user access.
Was this helpful?