Search code examples
marklogic

How to know user uses which port number in Marklogic


I'm working on compile a list of users and want to know which port number(8000 through 8007) do users currently have. Looking admin GUI I could not tell which port number users use in Marklogic. Is there way to find out.? Thanks

for an sample:

userA
port:8000,8001

userB
port: 8001,8002,8005

Solution

  • As explained by hunterhacker, users are not constrained to particular app servers, but there is a way to trace who accessed what server by looking at the access logs. Go to the Logs tab on the Admin UI landing page. Look for logs with AccessLog in their name. Ones ending with .txt are from today, ones ending with _1.txt are from yesterday, and so on. Inside you will find lines like:

    172.28.128.1 - admin [09/Oct/2018:06:57:09 +0000] "POST /qconsole/endpoints/queries.xqy?wsid=14089545771972940478&mode=javascript&cache=1539068229522 HTTP/1.1" 200 330 "http://ml903-ml1:8000/qconsole/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
    172.28.128.1 - admin [09/Oct/2018:06:57:09 +0000] "GET /qconsole/endpoints/queries.xqy?qid=2611273599340341106&cache=1539068230016 HTTP/1.1" 200 345 "http://ml903-ml1:8000/qconsole/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
    

    Each line begins with client ip, followed by two dashes in case it was an unauthenticated access attempt, or by one dash and the username for authenticated access.

    HTH!