Skip to content
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

mmsequence has no details on *how* to use global variables instead #799

Open
OrangeDog opened this issue Apr 2, 2019 · 10 comments
Open

Comments

@OrangeDog
Copy link

OrangeDog commented Apr 2, 2019

Do not use this module for newly crafted config files. Use global variables instead.

A link to some examples on equivalent configuration should be provided.
How do you generate random variables?
How do you generate incremental sequences?
How to you access the generated numbers in templates?

In fact, I don't think there's any documentation on global variables at all.
They're not mentioned in Variable (Property) types.

@orgads
Copy link

orgads commented Jun 17, 2019

Any progress on this?

@rgerhards
Copy link
Member

no - it's an open source project with limited ressources. Feel free to submit a PR. Or consider professional services if you need it very quickly ;-)

@rgerhards
Copy link
Member

as a side-note: reading up on global variables really helps. Set the var e.g. to zero and then increment it whenever you need. There is also a random function which you can use to init.

@OrangeDog
Copy link
Author

Feel free to submit a PR.

We don't know how to do it in the first place, so we can't write the documentation

reading up on global variables

Where?

@rgerhards
Copy link
Member

you have a point here. I thought we had a section on variables, but quick search just brought me to https://www.rsyslog.com/doc/master/rainerscript/variable_property_types.html?highlight=variables# (and more than quick search should not be required). I'll see if I can do anything against it, but as I said, there is unfortunately much to do :-(

@OrangeDog
Copy link
Author

I think I managed to set something up, but I'm not convinced that the increment is atomic.

@rgerhards
Copy link
Member

global variable updates are guarded by a mutex. So they are atomic. If you have a case where it is not, it's a bug. A good bug report together with diagnostic information would help solve it then.

@atc0005
Copy link
Contributor

atc0005 commented Jun 17, 2019

Potentially related (re doc coverage of variables): #592

@OrangeDog
Copy link
Author

global variable updates are guarded by a mutex

That's exactly the sort of thing that should be documented.

@davidelang
Copy link
Contributor

davidelang commented Jun 17, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants