Skip to content

Commit eebfc47

Browse files
Add logging attributes (#334)
1 parent 6409dad commit eebfc47

File tree

9 files changed

+717
-57
lines changed

9 files changed

+717
-57
lines changed

docs/data-sources/logging.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,24 @@ data "iosxe_logging" "example" {
4646
- `ipv6_hosts_transport` (Attributes List) (see [below for nested schema](#nestedatt--ipv6_hosts_transport))
4747
- `ipv6_vrf_hosts` (Attributes List) (see [below for nested schema](#nestedatt--ipv6_vrf_hosts))
4848
- `ipv6_vrf_hosts_transport` (Attributes List) (see [below for nested schema](#nestedatt--ipv6_vrf_hosts_transport))
49+
- `logging_count` (Boolean) Count every log message and timestamp last occurrence
4950
- `monitor_severity` (String)
5051
- `origin_id_name` (String) Define a unique text string as ID
5152
- `origin_id_type` (String) Use origin hostname/ip/ipv6 as ID
53+
- `persistent_batch` (Number) Batch size for writing to persistent storage
54+
- `persistent_filesize` (Number) Set size of individual log files
55+
- `persistent_immediate` (Boolean) Write log entry to storage immediately (no buffering).
56+
- `persistent_notify` (Boolean) Notify when show logging [persistent] is activated.
57+
- `persistent_protected` (Boolean) Eliminates manipulation on logging-persistent files
58+
- `persistent_size` (Number) Set disk space for writing log messages
59+
- `persistent_threshold` (Number) Setting threshold capacity. When setting circular logging is disabled
60+
- `persistent_url` (String) URL to store logging messages
61+
- `rate_limit_all` (Number) Messages per second
62+
- `rate_limit_all_except_severity` (String) Logging severity level
63+
- `rate_limit_console` (Number) Messages per second
64+
- `rate_limit_console_all` (Number) Messages per second
65+
- `rate_limit_console_all_except_severity` (String) Logging severity level
66+
- `rate_limit_console_except_severity` (String) Logging severity level
5267
- `source_interface` (String)
5368
- `source_interfaces_vrf` (Attributes List) Specify interface and vrf for source address in logging transactions (see [below for nested schema](#nestedatt--source_interfaces_vrf))
5469
- `trap` (Boolean) Set trap server logging level

docs/resources/logging.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ resource "iosxe_logging" "example" {
135135
]
136136
}
137137
]
138+
logging_count = true
139+
persistent_url = "flash:/local_logging"
140+
persistent_size = 1000000
141+
persistent_filesize = 500000
142+
rate_limit_all = 200
138143
}
139144
```
140145

@@ -166,10 +171,35 @@ resource "iosxe_logging" "example" {
166171
- `ipv6_hosts_transport` (Attributes List) (see [below for nested schema](#nestedatt--ipv6_hosts_transport))
167172
- `ipv6_vrf_hosts` (Attributes List) (see [below for nested schema](#nestedatt--ipv6_vrf_hosts))
168173
- `ipv6_vrf_hosts_transport` (Attributes List) (see [below for nested schema](#nestedatt--ipv6_vrf_hosts_transport))
174+
- `logging_count` (Boolean) Count every log message and timestamp last occurrence
169175
- `monitor_severity` (String)
170176
- `origin_id_name` (String) Define a unique text string as ID
171177
- `origin_id_type` (String) Use origin hostname/ip/ipv6 as ID
172178
- Choices: `hostname`, `ip`, `ipv6`
179+
- `persistent_batch` (Number) Batch size for writing to persistent storage
180+
- Range: `4096`-`2147483647`
181+
- `persistent_filesize` (Number) Set size of individual log files
182+
- Range: `8192`-`2147483647`
183+
- `persistent_immediate` (Boolean) Write log entry to storage immediately (no buffering).
184+
- `persistent_notify` (Boolean) Notify when show logging [persistent] is activated.
185+
- `persistent_protected` (Boolean) Eliminates manipulation on logging-persistent files
186+
- `persistent_size` (Number) Set disk space for writing log messages
187+
- Range: `16384`-`2147483647`
188+
- `persistent_threshold` (Number) Setting threshold capacity. When setting circular logging is disabled
189+
- Range: `1`-`99`
190+
- `persistent_url` (String) URL to store logging messages
191+
- `rate_limit_all` (Number) Messages per second
192+
- Range: `1`-`10000`
193+
- `rate_limit_all_except_severity` (String) Logging severity level
194+
- Choices: `alerts`, `critical`, `debugging`, `emergencies`, `errors`, `informational`, `notifications`, `warnings`
195+
- `rate_limit_console` (Number) Messages per second
196+
- Range: `1`-`10000`
197+
- `rate_limit_console_all` (Number) Messages per second
198+
- Range: `1`-`10000`
199+
- `rate_limit_console_all_except_severity` (String) Logging severity level
200+
- Choices: `alerts`, `critical`, `debugging`, `emergencies`, `errors`, `informational`, `notifications`, `warnings`
201+
- `rate_limit_console_except_severity` (String) Logging severity level
202+
- Choices: `alerts`, `critical`, `debugging`, `emergencies`, `errors`, `informational`, `notifications`, `warnings`
173203
- `source_interface` (String)
174204
- `source_interfaces_vrf` (Attributes List) Specify interface and vrf for source address in logging transactions (see [below for nested schema](#nestedatt--source_interfaces_vrf))
175205
- `trap` (Boolean) Set trap server logging level

examples/resources/iosxe_logging/resource.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,9 @@ resource "iosxe_logging" "example" {
120120
]
121121
}
122122
]
123+
logging_count = true
124+
persistent_url = "flash:/local_logging"
125+
persistent_size = 1000000
126+
persistent_filesize = 500000
127+
rate_limit_all = 200
123128
}

gen/definitions/logging.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,59 @@ attributes:
234234
- yang_name: profile
235235
example: PROF1
236236
exclude_test: true
237+
- yang_name: count
238+
tf_name: logging_count
239+
example: true
240+
- yang_name: persistent/url
241+
example: flash:/local_logging
242+
- yang_name: persistent/size
243+
example: 1000000
244+
- yang_name: persistent/filesize
245+
example: 500000
246+
- yang_name: persistent/batch
247+
example: 4096
248+
exclude_test: true
249+
- yang_name: persistent/threshold
250+
example: 50
251+
exclude_test: true
252+
- yang_name: persistent/immediate
253+
example: true
254+
exclude_test: true
255+
- yang_name: persistent/notify
256+
example: true
257+
exclude_test: true
258+
- yang_name: persistent/protected
259+
example: true
260+
exclude_test: true
261+
- yang_name: rate-limit-config/config-options/common-case/common-config/rate-limit/all/common-options/range
262+
xpath: rate-limit-config/common-config/rate-limit/all/common-options/range
263+
tf_name: rate_limit_all
264+
example: 200
265+
- yang_name: rate-limit-config/config-options/common-case/common-config/rate-limit/all/common-options/except/range
266+
xpath: rate-limit-config/common-config/rate-limit/all/common-options/except/range
267+
tf_name: rate_limit_all_except_severity
268+
example: warnings
269+
exclude_test: true
270+
- yang_name: rate-limit-config/config-options/common-case/common-config/rate-limit/console/common-options/range
271+
xpath: rate-limit-config/common-config/rate-limit/console/common-options/range
272+
tf_name: rate_limit_console
273+
example: 100
274+
exclude_test: true
275+
- yang_name: rate-limit-config/config-options/common-case/common-config/rate-limit/console/common-options/except/range
276+
xpath: rate-limit-config/common-config/rate-limit/console/common-options/except/range
277+
tf_name: rate_limit_console_except_severity
278+
example: errors
279+
exclude_test: true
280+
- yang_name: rate-limit-config/config-options/common-case/common-config/rate-limit/console/all/common-options/range
281+
xpath: rate-limit-config/common-config/rate-limit/console/all/common-options/range
282+
tf_name: rate_limit_console_all
283+
example: 150
284+
exclude_test: true
285+
- yang_name: rate-limit-config/config-options/common-case/common-config/rate-limit/console/all/common-options/except/range
286+
xpath: rate-limit-config/common-config/rate-limit/console/all/common-options/except/range
287+
tf_name: rate_limit_console_all_except_severity
288+
example: critical
289+
exclude_test: true
237290

238291
test_prerequisites:
239292
- path: Cisco-IOS-XE-native:native/vrf/definition=VRF1

internal/provider/data_source_iosxe_logging.go

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/provider/data_source_iosxe_logging_test.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)