Search code examples
graylog

How to change the Username of a graylog user


I imported a bunch of users into graylog by copying info from my outlook address book. We're using the email address as the user name. It turns out that graylog user names are case sensitive, and several of the outlook e-mail addresses have bonus uppercase letters, whereas it's just best to have the graylog user names to be all lower-case.

So I need to change the Username for the graylog accounts. But, the GUI only lets me change the display name and the e-mail address. There doesn't seem to be any way at all to change the user name.

I suppose I could delete the users and create new ones with proper name casing, but that makes me nauseous.

How can I change the user name of a graylog account?

p.s. this is not the same question as How to change the username in graylog , that's about changing the admin user name.

p.p.s. the hosting system is Debian Linux, and not using Docker or any other VM or sandbox


Solution

  • You have to change the username in the mongo db which graylog uses for configuration. The graylog gui does not provide a way to do that as far as I know.

    Start the mongo shell by running "mongo" from a terminal window, then you can use these commands to look at or update users:

    // switch to the greylog database
    use graylog
    
    // lookup all users
    db.users.find()
    
    // look up the specific user object that you want to target
    db.users.find({username:"[email protected]"})
    
    // update the target user object 
    db.users.update({username:"[email protected]"},{$set: {username:"[email protected]"}});