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

Light: add loggen support #3441

Merged
merged 1 commit into from Oct 1, 2020
Merged

Conversation

norberttak
Copy link
Contributor

@norberttak norberttak commented Sep 29, 2020

Add the possibility to use loggen from Light scripts.

Typical use:
loggen.start("127.0.0.1", 6666, tcp=True, inet=True, rate=1)

@kira-syslogng
Copy link
Contributor

Build SUCCESS

@norberttak norberttak changed the title Signed-off-by: Norbert Takacs <norbert.takacs@oneidentity.com> Light: add loggen support Sep 29, 2020
@alltilla
Copy link
Collaborator

I would rather have something like:

loggen.start("127.0.0.1", 6666, tcp=True, inet=True, rate=1)

@kira-syslogng
Copy link
Contributor

Build SUCCESS

@norberttak
Copy link
Contributor Author

I would rather have something like:

loggen.start("127.0.0.1", 6666, tcp=True, inet=True, rate=1)

@norberttak norberttak closed this Sep 29, 2020
@norberttak norberttak reopened this Sep 29, 2020
@kira-syslogng
Copy link
Contributor

Build SUCCESS

@kira-syslogng
Copy link
Contributor

Build SUCCESS

@kira-syslogng
Copy link
Contributor

Build SUCCESS

alltilla
alltilla previously approved these changes Sep 30, 2020
Copy link
Collaborator

@alltilla alltilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kira-syslogng
Copy link
Contributor

Build SUCCESS


instanceIndex = -1
@staticmethod
def get_new_instance_index():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should start with _ to make it "private".

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little fun with the count generator, if you want to:

import itertools
class Loggen(object):
    index = itertools.count()
    get_new_index = lambda : next(Loggen.index)

print(Loggen.get_new_index())
print(Loggen.get_new_index())

You can add _ in the front too for personal preference.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved from my side. Thanks! :)

@alltilla alltilla dismissed their stale review October 1, 2020 07:05

Found some things that need change.

self.loggen_proc = None
self.loggen_bin_path = tc_parameters.INSTANCE_PATH.get_loggen_bin()

def _decode_start_parameters(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing parameter:

-s, --size=<size> Specify the size of the syslog message

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@norberttak I think this is still missing.

@kira-syslogng
Copy link
Contributor

Build SUCCESS

Signed-off-by: Norbert Takacs <norbert.takacs@oneidentity.com>
@kira-syslogng
Copy link
Contributor

Build SUCCESS

@furiel furiel merged commit 2672fa6 into syslog-ng:master Oct 1, 2020
@szemere
Copy link
Collaborator

szemere commented Oct 1, 2020

Yes!

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

Successfully merging this pull request may close these issues.

None yet

6 participants