Re: system.profile Username

35 views
Skip to first unread message

Dwight Merriman

unread,
Oct 15, 2012, 3:03:01 PM10/15/12
to mongod...@googlegroups.com
are you running with --auth?  if not that field will be blank.

also, if you run db.currentOp() it will show you the IP address of the client -- which might be helpful.


On Monday, October 15, 2012 12:40:24 PM UTC-4, Søren Bramer Schmidt wrote:
When i look in system.profile the user field is always empty, like "user" : "". Is this expected, or am i doing something wrong?

I run 2.2.0 on linux and the latest .net driver.

For our sql server setup we have individual logins for each application (of which we have 50) making it really easy to find the offending application when we see slow queries. I would really love to be able to do the same with mongo.

Thanks!

Søren Bramer Schmidt

unread,
Oct 17, 2012, 6:22:17 AM10/17/12
to mongod...@googlegroups.com
Thank you Dwight

We do have authentication enabled. IP address is useful, but not sufficient for us. Could there be other reasons why the user field is blank?

a sample document:

/* 0 */
{
  "ts" : ISODate("2012-10-15T14:35:36.598Z"),
  "op" : "update",
  "ns" : "Trustpilot.ReviewSummary",
  "query" : {
...
  },
  "updateobj" : {
    "$set" : {
...
      }
    }
  },
  "nscanned" : 3565,
  "nupdated" : 3565,
  "keyUpdates" : 0,
  "numYield" : 21,
  "lockStats" : {
    "timeLockedMicros" : {
      "r" : NumberLong(0),
      "w" : NumberLong(1976534)
    },
    "timeAcquiringMicros" : {
      "r" : NumberLong(0),
      "w" : NumberLong(948800)
    }
  },
  "millis" : 947,
  "client" : "176.34.138.250",
  "user" : ""

Dwight Merriman

unread,
Oct 17, 2012, 1:41:11 PM10/17/12
to mongod...@googlegroups.com
you will get "" for a user connecting from localhost that has not explicitly authenticated under a specific username.
Reply all
Reply to author
Forward
0 new messages