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

Update RSyslog HLD with new functionality #1218

Merged
merged 4 commits into from
May 30, 2023

Conversation

iavraham
Copy link
Contributor

@iavraham iavraham commented Jan 16, 2023

Adding the following functionality:

  • Configure remote syslog servers: protocol, filter, trap severity level
  • Update global syslog configuration: trap severity kevel, message format

these are the implementation PRs for community review:

Repo PR title State
sonic-swss-common [rsyslog]add syslog global config to db GitHub issue/pull request detail
sonic-host-services [rsyslog]Add remote syslog configuration GitHub issue/pull request detail
sonic-buildimage [rsyslog]Add remote syslog configuration GitHub issue/pull request detail
sonic-utilities [syslog] Adjust runningconfiguration syslog command GitHub issue/pull request detail

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 16, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@iavraham iavraham changed the title rsyslog hld update Update RSyslog HLD with new functionality Jan 16, 2023
Comment on lines 1 to 9
# 1. SONiC Syslog Source IP

## 1.1. High Level Design document

## 1.2. Table of contents

- [1. SONiC Syslog Source IP](#1-sonic-syslog-source-ip)
- [1.1. High Level Design document](#11-high-level-design-document)
- [1.2. Table of contents](#12-table-of-contents)
Copy link
Contributor

@fastiuk fastiuk Jan 17, 2023

Choose a reason for hiding this comment

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

We need to get rid of section numbers here and remove them from table of content.
You can use "<!-- omit in toc -->" directive. See here

@@ -503,12 +758,14 @@ module sonic-syslog {

leaf server_address {
description "Syslog server IP address";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggest to update the description.
The server address represents either an IP address or a DNS domain name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


leaf format {
description "Log format";
type log-format;
Copy link
Collaborator

@venkatmahalingam venkatmahalingam Jan 17, 2023

Choose a reason for hiding this comment

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

Can we add a default 'standard' field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

@zhangyanzhao
Copy link
Collaborator

@dharmaraj-gurusamy wants to be the reviewer.

| 0.1 | 18/04/2022 | Nazarii Hnydyn | Initial version |

## About this manual
# 1. SONiC Syslog Source IP
Copy link
Collaborator

Choose a reason for hiding this comment

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

The original document has this as title & Introduction is marked as section 1. All section numbers seems incremented. Please correct the document headers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

| Rev | Date | Author | Description |
|:---:|:----------:|:--------------:|:----------------------|
| 0.1 | 18/04/2022 | Nazarii Hnydyn | Initial version |
| 0.2 | 08/01/2023 | Ido Avraham | extend capabilities |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add short note about the extended capabilities.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added detailed description

| Parameter | Default | Description |
|:-------------------|:---------|:------------------------------------------------------------------------------|
| format | standard | template format |
| trap | notice | messages with severity equal or grater then this severity will be forwarded |
Copy link
Collaborator

Choose a reason for hiding this comment

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

severity will be a better name as trap may confuse with SNMP terminology. Please keep uniform name for both global & server specific configuration parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we defined this name in our internal usage so we would prefer to leave it like that.
is it acceptable by you?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The man page (https://www.rsyslog.com/doc/v8-stable/configuration/filters.html) states priority / severity term. Hence, I would still recommend to rename either as severity / priority for better conveying the purpose.

doc/syslog/syslog-design.md Outdated Show resolved Hide resolved
| trap | priority | SYSLOG_CONFIG\|GLOBAL\|trap |
| welf_firewall_name | trap | SYSLOG_CONFIG\|GLOBAL\|welf_firewall_name |

* trap will set rules trap severity if not specified in the rule
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please share more details on this statement, preferably with an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

@@ -444,7 +657,7 @@ config syslog add '2.2.2.2' \
config syslog del '2.2.2.2'
```

#### 2.6.2.2 Show command group
#### 3.6.2.2. Show command group

**The following command shows syslog server configuration:**
Copy link
Collaborator

Choose a reason for hiding this comment

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

The extended parameters shall be displayed in show command output also for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

or (/mvrf:sonic-mgmt_vrf/mvrf:MGMT_VRF_CONFIG/mvrf:vrf_global/mvrf:mgmtVrfEnabled = 'true')";
}

leaf filter {
Copy link
Collaborator

Choose a reason for hiding this comment

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

filter_type will be the better name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will change

type rsyslog-protocol;
}

leaf trap {
Copy link
Collaborator

Choose a reason for hiding this comment

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

severity will be the better name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

answered above

}

leaf trap {
type rsyslog-severity;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add the default value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

| device | none | Bind socket to given device (e.g., eth0/vrf0) |
| ipfreebind | 2 | Manages the IP_FREEBIND option on the UDP socket |
| filter | none | compares the log against the provided regular expression |
| priority | notice | logs with specified priority and higher will be forwarded |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will the default values be added in redis during upgrade scenarios (db_migrator script)? If not, we might end up in inconsistency after upgrade?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if the keys are empty we will use the global default value in the template

doc/syslog/syslog-design.md Outdated Show resolved Hide resolved
| Parameter | Default | Description |
|:-------------------|:---------|:------------------------------------------------------------------------------|
| format | standard | template format |
| trap | notice | messages with severity equal or grater then this severity will be forwarded |
Copy link
Collaborator

Choose a reason for hiding this comment

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

The man page (https://www.rsyslog.com/doc/v8-stable/configuration/filters.html) states priority / severity term. Hence, I would still recommend to rename either as severity / priority for better conveying the purpose.

@iavraham
Copy link
Contributor Author

to merge the submodules, we first need to merge sonic-swss-common and then we can pass CI tests

@SavchukRomanLv
Copy link

@iavraham any time line when feature can be approved and merged? Thank you!

@fastiuk
Copy link
Contributor

fastiuk commented May 11, 2023

@iavraham any time line when feature can be approved and merged? Thank you!

We answered/closed all comments in this PR. Now we are waiting for maintainers to approve and merge it.

@qiluo-msft qiluo-msft requested a review from wen587 May 13, 2023 00:47
@wen587
Copy link
Contributor

wen587 commented May 15, 2023

Will review before 5/25


Linux kernel decides which source IP to use within the default VRF.

**Example:**
```
*.* action(type="omfwd" target="2.2.2.2" protocol="udp")
*.notice action(type="omfwd" target="2.2.2.2" protocol="udp")
Copy link
Contributor

Choose a reason for hiding this comment

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

Current 'show runningconfiguration syslog' is matching lines starting with '.'.
Will it break the show cli function? https://github.com/sonic-net/sonic-utilities/blob/master/show/main.py#L1687

Copy link
Contributor

Choose a reason for hiding this comment

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

Will it break the show cli function?

It will. I fixed it here: sonic-net/sonic-utilities#2843

@qiluo-msft qiluo-msft merged commit 4efe273 into sonic-net:master May 30, 2023
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.

8 participants