-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update MongoDB protocol with new opcodes #6191
Comments
It seems the mongodb parser needs to be updated with new operations added to the protocol. Btw I will push a quick fix for that error message to print the actual operation code |
This missing ones are
Should we really implement this? @adriansr |
@jaipradeesh I see, if they are deprecated then implementing might be a waste of time. However, we should at least expect to see those messages and don't log an error every time. |
freenode/#mongodb logs - 2018-02-27
@ruflin In such case, I don't think validating across the whitelist of opcodes is necessary. What do you think? // @adriansr |
I leave it to @adriansr to comment :-) |
@adriansr What do you think? |
Hi @jaipradeesh Sorry about taking so long to respond to this, I screwed up my github notifications. So I understand the whole point in here is to have packetbeat ignore these opcodes and not log an error every time it receives one. I don't think this is a problem, maybe Derick from MongoDB is understanding something different as to what whitelist and blacklist mean. We are not blocking this opcodes from being sent, we just don't want to store an event in Elasticsearch nor log an error. Have you been able to test it and confirm that no more |
Okay. So, if we don't maintain a list of supported opcodes, then in those cases, |
MongoDB added another opcode |
I'm interested in taking up this issue (adding the new One way I can think of is to query mongoDB for its version when packetbeat starts, but might have to introduce a new dependency (eg mongo-go-driver). Being able to differentiate versions could also be useful in future as mongoDB opcodes seem to change quite frequently. Otherwise if we are not concerned about ensuring backward compatibility we can simply replace the old code with the new one. Should I also open a separate issue for this? |
@pohzipohzi to me querying mongoDB is a big no-no. Packetbeat analysis should stay passive. Isn't the protocol versioned so we can tell which version is in use? |
@pohzipohzi Looking at the MongoDB documentation it looks like the "new" |
@cwurm I was thinking if mongoDB overwrites one of the opcodes in future, this solution might become a problem. However assuming that that does not happen this is a fine option. @adriansr I agree that querying mongoDB is not the way to go. I have not explored looking at version protocols, but I think I shall stick with @cwurm 's solution for now. Thanks for the input! |
Waiting for this one. Our MongoDB monitoring use this and we are going to upgrade to MongoDB 4.0 on PROD this week. After that we will lose the ability to see the MongoDB traffic. |
Hi, Is there any update on this issue. |
Now the latest version of packetbeat(7.15) can recognize the information of mongodb OP_MSG. But there seem to be some defects.When packet beat parses OP_MSG type, the output field mongodb is empty. In addition, the most important thing is that there is no end time and no overall response time in the event output field. Parsing output of type OP_MSG: Parsing output of earlier types: |
Hi! We're labeling this issue as |
|
Hi! We're labeling this issue as |
This is still very relevant. I'm surprised it doesn't have more attention. 👍 |
#28858 Here is a detailed description of the problem |
Please post all questions and issues on https://discuss.elastic.co/c/beats
before opening a Github Issue. Your questions will reach a wider audience there,
and if we confirm that there is a bug, then you can open a new issue.
For security vulnerabilities please only send reports to [email protected].
See https://www.elastic.co/community/security for more information.
For confirmed bugs, please report:
[root@contents-mongo-dev-01 packetbeat-6.1.2-linux-x86_64]# /beat/packetbeat-6.1.2-linux-x86_64/packetbeat -c /beat/packetbeat-6.1.2-linux-x86_64/packetbeat.yml -e
Q) When packetbeat is executed, the following error occurs.
2018/01/26 06:30:01.311175 mongodb_parser.go:42: ERR Unknown operation code:
2018/01/26 06:30:01.311872 mongodb_parser.go:42: ERR Unknown operation code:
2018/01/26 06:30:01.311902 mongodb_parser.go:42: ERR Unknown operation code:
2018/01/26 06:30:01.311928 mongodb_parser.go:42: ERR Unknown operation code:
2018/01/26 06:30:01.403019 mongodb_parser.go:42: ERR Unknown operation code:
2018/01/26 06:30:01.403631 mongodb_parser.go:42: ERR Unknown operation code:
Q) My setup is as below and I simply linked it to the logstash. Please check the cause of the above error.
[root@contents-mongo-dev-01 packetbeat-6.1.2-linux-x86_64]# cat packetbeat.yml | grep -v '#'
packetbeat.interfaces.device: any
packetbeat.flows:
timeout: 30s
period: 10s
packetbeat.protocols:
ports: [27017]
send_request: true
send_response: true
max_docs: 0
max_doc_length: 0
setup.template.settings:
index.number_of_shards: 3
setup.kibana:
output.elasticsearch:
hosts: ["internal-bh-elasticsearch-lb-1602908268.ap-northeast-2.elb.amazonaws.com:9200"]
logging.level: error
The text was updated successfully, but these errors were encountered: