-
Notifications
You must be signed in to change notification settings - Fork 22
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
Issue #24 Limit size of Document. #42
Conversation
thanks for your contribution @eperry - so using the The For example irb(main):019:0> {:a=>1, :b=>2, :c=>{:d=>3, :e=>4}}.each_pair{|k, v| puts("#{k} => #{v}")}
a => 1
b => 2
c => {:d=>3, :e=>4} So using this example, events would be created for Is that you intention here? |
Yes that is correct, each "attribute" of the object event, would become a seperate object. The sudo code you wrote would be accurate in its description ( as I read it). The intent, is that Batch: is all information is included in event becomes one document ( which could be XX MB ) Single: is only one OID in a single Document. (Future possible OID description,....) When I get to work tomorrow, I will provide a couple example of the documents created, as I put the code in to "QA" already |
@eperry My hesitation is about a walk operation result where, for example, it could contain 2 OIDs: the first one with a scalar value and the second with a whole subtree of data which could be of unknown size. Using this example, your suggested strategy would yield two events; the first one with the OID and the scalar value and a second one with a whole subtree of data. So I am wondering if this approach will work practically? |
Well abstractly your correct but that is not how the "event" field is being created within the SNMP Document. It is a flat list of key:values the value is either a string or in. There are no subtree's
so this above document would be split into 3 different documents
The reason to do this. So if you wanted to list all the installed RPM, Netstat or even all the running processes.
splitting this into separate documents, prevents "HUGE" documents from being created. Some of the snmp walks I am creating have 20k different metrics, and while I probably don't want that many. even a document with 5000 fields is a lot. |
@eperry damn - disregard my subtree hallucination, indeed everything is flattened. Here's what I suggest: I would like this refactored a bit and tests added, depending on what you prefer we can either discuss here what I would like or I can create a new PR, copy your commit (so your authorship & history is preserved) and I can make some modifications on top of it. Let me know what you prefer for this. |
No worries, I had to think about it a little bit too. It is a good question. I am not a great programmer (System Admin by trade) , so any help you can provide would be greatly appreciated to clean it up and be acceptable. I will be glad to do what is needed but I would need a little extra coaching to do it myself. |
I took a first shot at writing a "Mode" parameter which specifies how to create Logstash Events. For Issue #24
Batch = the current way, where all OID's are in a Single document. (Default)
Single = Each OID will be put in to its one document.
Single mode later on enhanced to provide additional information about about each OID, like description and so on like SNMPINFO provides.