Looking into the database of Opensearch and MongoDB

I would like to know if it is possible to access the Opensearch and MongoDB Database to see what table is inside?

Understanding that Opensearch is to store all the log inside and MongoDB is to store the configuration of the Graylog.

If this is possible how am I supposes to do it and what is the user login and password.

You can login to MongoDB and look it come with default password - you can use local Server to login.

Will you be able to guide me on how to do it?

When I went into mongod.conf , it mention that the storage will be in the /var/lib/mongodb. However, I do not have any of this folder.

Is there a chance that, my configuration is wrong somewhere?

If you want to explore the MongoDB database I highly suggest using studio 3T it makes it much easier Ultimate GUI for MongoDB | Studio 3T

There is either no user account or you can find the login account in your Graylog server.conf because it would need the account as well.

Hey @Joel_Duffield Thanks for your reply.

I have downloaded it and try to connect it, however it fail to connect.
Understanding that this is not your product, but will you be able to guide me on how to make it connect.

As for the server.conf I try to see the configuration on it, I only able to see the following that is related to mongodb.

So this post explains how to create a user and turn on remote connectivity, but it is not Graylog specific (mongo is local only by default) however if you follow this then you will need to change the Graylog server.conf to have it also use that account to connect as it will now be required. Also use your firewall to limit access, you do not want someone hacking your MongoDB.

Good Day @Joel_Duffield

Thanks for sharing with me this post.

I have try using the mongo however, it show me the following error:

user1@graylog01:/etc/graylog/server$ mongo
Command 'mongo' not found, did you mean:
  command 'mono' from deb mono-runtime (6.8.0.105+dfsg-3.2)
Try: sudo apt install <deb name>

The funny thing is, I did not see any mongodb inside my /var/lib folder. I have install my mongoDB on my Ubuntu using all the command on the Graylog installation guide.

Do correct me if I wrong. So after creating the user and edit it on my graylog server.conf, will my Graylog configuration be missing? Or my Graylog will be still working fine?

Sorry for the trouble. I still new to this.

Thanks

It’s possible that you are on a different mongo version than the article, so you may need a slightly different command because of that, they changed some of them I little while back.

Once you have forced user accounts to be needed to login to mongo, if you don’t add that account to your Graylog config then it won’t be able to access mongo and Graylog will not work.

i have manage to created the account. However, I have an issue when I restarted my mongod and graylog-server.

I got this error:

When I try to configure back to the setting where, my Graylog is working, my graylog still failed.

What troubleshooting I able to do, beside doing a roll back.

Can you post your MongoDB config as well as your Graylog server.conf (it’s fine to remove the passwords etc)

hey,

here my server.conf:

here my mongod.conf:

Creating an user account on mongosh:

Do let me know if there is any other thing you need.

Have you verified that if you login to MongoDB with the user account you created for Graylog that you can read from the Graylog database etc?

How do you do that?

After I added the “kit” user. i only did the following.

server.conf:
mongodb://kit:[secret]@192.168.1.218:27017/graylog

mongod.conf:
net:
bindIP: 0.0.0.0

security:
authorixation: ‘enable’

Is there anything i still need to change?
I have confirm on my mariaDB, that I about to login to my account.

Hey @wilsonshow

Not sure what version on mongo you have, what I executed was something like this I I create my username and password prior using mongo shell.

mongo --port 27017 -u mongo_admin -p 'my_password'

Hey all,

I am able to create and access it successfully.
Thank for all your help to make it worked.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.