Skip to content

Commit 1afa2c5

Browse files
authored
Merge branch 'MicrosoftDocs:main' into main
2 parents d131c0a + b63efb2 commit 1afa2c5

File tree

9 files changed

+411
-308
lines changed

9 files changed

+411
-308
lines changed

articles/active-directory/develop/app-resilience-continuous-access-evaluation.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,20 @@ You can test your application by signing in a user to the application then using
104104
When these conditions are met, the app can extract the claims challenge from the API response header as follows:
105105

106106
```javascript
107-
const authenticateHeader = response.headers.get('www-authenticate');
108-
const claimsChallenge = parseChallenges(authenticateHeader).claims;
109-
110-
// ...
107+
try {
108+
const response = await fetch(apiEndpoint, options);
109+
110+
if (response.status === 401 && response.headers.get('www-authenticate')) {
111+
const authenticateHeader = response.headers.get('www-authenticate');
112+
const claimsChallenge = parseChallenges(authenticateHeader).claims;
113+
114+
// use the claims challenge to acquire a new access token...
115+
}
116+
} catch(error) {
117+
// ...
118+
}
111119

120+
// helper function to parse the www-authenticate header
112121
function parseChallenges(header) {
113122
const schemeSeparator = header.indexOf(' ');
114123
const challenges = header.substring(schemeSeparator + 1).split(',');
@@ -126,24 +135,20 @@ function parseChallenges(header) {
126135
Your app would then use the claims challenge to acquire a new access token for the resource.
127136

128137
```javascript
138+
const tokenRequest = {
139+
claims: window.atob(claimsChallenge), // decode the base64 string
140+
scopes: ['User.Read']
141+
account: msalInstance.getActiveAccount();
142+
};
143+
129144
let tokenResponse;
130145

131146
try {
132-
tokenResponse = await msalInstance.acquireTokenSilent({
133-
claims: window.atob(claimsChallenge), // decode the base64 string
134-
scopes: scopes, // e.g ['User.Read', 'Contacts.Read']
135-
account: account, // current active account
136-
});
137-
147+
tokenResponse = await msalInstance.acquireTokenSilent(tokenRequest);
138148
} catch (error) {
139149
if (error instanceof InteractionRequiredAuthError) {
140-
tokenResponse = await msalInstance.acquireTokenPopup({
141-
claims: window.atob(claimsChallenge), // decode the base64 string
142-
scopes: scopes, // e.g ['User.Read', 'Contacts.Read']
143-
account: account, // current active account
144-
});
150+
tokenResponse = await msalInstance.acquireTokenPopup(tokenRequest);
145151
}
146-
147152
}
148153
```
149154

@@ -154,8 +159,7 @@ const msalConfig = {
154159
auth: {
155160
clientId: 'Enter_the_Application_Id_Here',
156161
clientCapabilities: ["CP1"]
157-
// the remaining settings
158-
// ...
162+
// remaining settings...
159163
}
160164
}
161165

articles/azure-monitor/agents/agent-manage.md

Lines changed: 95 additions & 72 deletions
Large diffs are not rendered by default.

articles/azure-monitor/agents/agent-windows-troubleshoot.md

Lines changed: 63 additions & 60 deletions
Large diffs are not rendered by default.

articles/azure-monitor/agents/data-collection-rule-azure-monitor-agent.md

Lines changed: 53 additions & 52 deletions
Large diffs are not rendered by default.

articles/azure-monitor/agents/data-sources-syslog.md

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
---
2-
title: Collect Syslog data sources with Log Analytics agent in Azure Monitor
3-
description: Syslog is an event logging protocol that is common to Linux. This article describes how to configure collection of Syslog messages in Log Analytics and details of the records they create.
2+
title: Collect Syslog data sources with the Log Analytics agent in Azure Monitor
3+
description: Syslog is an event logging protocol that's common to Linux. This article describes how to configure collection of Syslog messages in Log Analytics and details the records they create.
44
ms.topic: conceptual
55
ms.date: 04/06/2022
66
ms.reviewer: luki
77

88
---
99

10-
# Collect Syslog data sources with Log Analytics agent
11-
Syslog is an event logging protocol that is common to Linux. Applications will send messages that may be stored on the local machine or delivered to a Syslog collector. When the Log Analytics agent for Linux is installed, it configures the local Syslog daemon to forward messages to the agent. The agent then sends the message to Azure Monitor where a corresponding record is created.
10+
# Collect Syslog data sources with the Log Analytics agent
1211

13-
[!INCLUDE [Log Analytics agent deprecation](../../../includes/log-analytics-agent-deprecation.md)]
12+
Syslog is an event logging protocol that's common to Linux. Applications send messages that might be stored on the local machine or delivered to a Syslog collector. When the Log Analytics agent for Linux is installed, it configures the local Syslog daemon to forward messages to the agent. The agent then sends the messages to Azure Monitor where a corresponding record is created.
1413

14+
[!INCLUDE [Log Analytics agent deprecation](../../../includes/log-analytics-agent-deprecation.md)]
1515

1616
> [!NOTE]
17-
> Azure Monitor supports collection of messages sent by rsyslog or syslog-ng, where rsyslog is the default daemon. The default syslog daemon on version 5 of Red Hat Enterprise Linux, CentOS, and Oracle Linux version (sysklog) is not supported for syslog event collection. To collect syslog data from this version of these distributions, the [rsyslog daemon](http://rsyslog.com) should be installed and configured to replace sysklog.
17+
> Azure Monitor supports collection of messages sent by rsyslog or syslog-ng, where rsyslog is the default daemon. The default Syslog daemon on version 5 of Red Hat Enterprise Linux, CentOS, and Oracle Linux version (sysklog) isn't supported for Syslog event collection. To collect Syslog data from this version of these distributions, the [rsyslog daemon](http://rsyslog.com) should be installed and configured to replace sysklog.
1818
19-
20-
![Syslog collection](media/data-sources-syslog/overview.png)
19+
![Diagram that shows Syslog collection.](media/data-sources-syslog/overview.png)
2120

2221
The following facilities are supported with the Syslog collector:
2322

@@ -36,29 +35,33 @@ The following facilities are supported with the Syslog collector:
3635
* local0-local7
3736

3837
For any other facility, [configure a Custom Logs data source](data-sources-custom-logs.md) in Azure Monitor.
39-
40-
## Configuring Syslog
38+
39+
## Configure Syslog
40+
4141
The Log Analytics agent for Linux will only collect events with the facilities and severities that are specified in its configuration. You can configure Syslog through the Azure portal or by managing configuration files on your Linux agents.
4242

4343
### Configure Syslog in the Azure portal
44+
4445
Configure Syslog from the [Agent configuration menu](../agents/agent-data-sources.md#configuring-data-sources) for the Log Analytics workspace. This configuration is delivered to the configuration file on each Linux agent.
4546

46-
You can add a new facility by clicking **Add facility**. For each facility, only messages with the selected severities will be collected. Check the severities for the particular facility that you want to collect. You cannot provide any additional criteria to filter messages.
47+
You can add a new facility by selecting **Add facility**. For each facility, only messages with the selected severities will be collected. Select the severities for the particular facility that you want to collect. You can't provide any other criteria to filter messages.
4748

48-
[![Configure Syslog](media/data-sources-syslog/configure.png)](media/data-sources-syslog/configure.png#lightbox)
49+
[![Screenshot that shows configuring Syslog.](media/data-sources-syslog/configure.png)](media/data-sources-syslog/configure.png#lightbox)
4950

50-
By default, all configuration changes are automatically pushed to all agents. If you want to configure Syslog manually on each Linux agent, then uncheck the box *Apply below configuration to my machines*.
51+
By default, all configuration changes are automatically pushed to all agents. If you want to configure Syslog manually on each Linux agent, clear the **Apply below configuration to my machines** checkbox.
5152

5253
### Configure Syslog on Linux agent
53-
When the [Log Analytics agent is installed on a Linux client](../vm/monitor-virtual-machine.md), it installs a default syslog configuration file that defines the facility and severity of the messages that are collected. You can modify this file to change the configuration. The configuration file is different depending on the Syslog daemon that the client has installed.
54+
55+
When the [Log Analytics agent is installed on a Linux client](../vm/monitor-virtual-machine.md), it installs a default Syslog configuration file that defines the facility and severity of the messages that are collected. You can modify this file to change the configuration. The configuration file is different depending on the Syslog daemon that the client has installed.
5456

5557
> [!NOTE]
56-
> If you edit the syslog configuration, you must restart the syslog daemon for the changes to take effect.
58+
> If you edit the Syslog configuration, you must restart the Syslog daemon for the changes to take effect.
5759
>
5860
>
5961
6062
#### rsyslog
61-
The configuration file for rsyslog is located at **/etc/rsyslog.d/95-omsagent.conf**. Its default contents are shown below. This collects syslog messages sent from the local agent for all facilities with a level of warning or higher.
63+
64+
The configuration file for rsyslog is located at `/etc/rsyslog.d/95-omsagent.conf`. Its default contents are shown in the following example. This example collects Syslog messages sent from the local agent for all facilities with a level of warning or higher.
6265

6366
```config
6467
kern.warning @127.0.0.1:25224
@@ -80,14 +83,15 @@ local6.warning @127.0.0.1:25224
8083
local7.warning @127.0.0.1:25224
8184
```
8285

83-
You can remove a facility by removing its section of the configuration file. You can limit the severities that are collected for a particular facility by modifying that facility's entry. For example, to limit the user facility to messages with a severity of error or higher you would modify that line of the configuration file to the following:
86+
You can remove a facility by removing its section of the configuration file. You can limit the severities that are collected for a particular facility by modifying that facility's entry. For example, to limit the user facility to messages with a severity of error or higher, you would modify that line of the configuration file to the following example:
8487

8588
```config
8689
user.error @127.0.0.1:25224
8790
```
8891

8992
#### syslog-ng
90-
The configuration file for syslog-ng is location at **/etc/syslog-ng/syslog-ng.conf**. Its default contents are shown below. This collects syslog messages sent from the local agent for all facilities and all severities.
93+
94+
The configuration file for syslog-ng is located at `/etc/syslog-ng/syslog-ng.conf`. Its default contents are shown in this example. This example collects Syslog messages sent from the local agent for all facilities and all severities.
9195

9296
```config
9397
#
@@ -140,23 +144,24 @@ filter f_user_oms { level(alert,crit,debug,emerg,err,info,notice,warning) and fa
140144
log { source(src); filter(f_user_oms); destination(d_oms); };
141145
```
142146

143-
You can remove a facility by removing its section of the configuration file. You can limit the severities that are collected for a particular facility by removing them from its list. For example, to limit the user facility to just alert and critical messages, you would modify that section of the configuration file to the following:
147+
You can remove a facility by removing its section of the configuration file. You can limit the severities that are collected for a particular facility by removing them from its list. For example, to limit the user facility to alert only critical messages, you would modify that section of the configuration file as shown in the following example:
144148

145149
```config
146150
#OMS_facility = user
147151
filter f_user_oms { level(alert,crit) and facility(user); };
148152
log { source(src); filter(f_user_oms); destination(d_oms); };
149153
```
150154

151-
### Collecting data from additional Syslog ports
152-
The Log Analytics agent listens for Syslog messages on the local client on port 25224. When the agent is installed, a default syslog configuration is applied and found in the following location:
155+
### Collect data from other Syslog ports
156+
157+
The Log Analytics agent listens for Syslog messages on the local client on port 25224. When the agent is installed, a default Syslog configuration is applied and found in the following location:
153158

154159
* Rsyslog: `/etc/rsyslog.d/95-omsagent.conf`
155160
* Syslog-ng: `/etc/syslog-ng/syslog-ng.conf`
156161

157-
You can change the port number by creating two configuration files: a FluentD config file and a rsyslog-or-syslog-ng file depending on the Syslog daemon you have installed.
162+
You can change the port number by creating two configuration files: a FluentD config file and a rsyslog-or-syslog-ng file depending on the Syslog daemon you have installed.
158163

159-
* The FluentD config file should be a new file located in: `/etc/opt/microsoft/omsagent/conf/omsagent.d` and replace the value in the **port** entry with your custom port number.
164+
* The FluentD config file should be a new file located in `/etc/opt/microsoft/omsagent/conf/omsagent.d` and replace the value in the `port` entry with your custom port number.
160165

161166
```xml
162167
<source>
@@ -170,7 +175,7 @@ You can change the port number by creating two configuration files: a FluentD co
170175
type filter_syslog
171176
```
172177

173-
* For rsyslog, you should create a new configuration file located in: `/etc/rsyslog.d/` and replace the value %SYSLOG_PORT% with your custom port number.
178+
* For rsyslog, you should create a new configuration file located in `/etc/rsyslog.d/` and replace the value `%SYSLOG_PORT%` with your custom port number.
174179

175180
> [!NOTE]
176181
> If you modify this value in the configuration file `95-omsagent.conf`, it will be overwritten when the agent applies a default configuration.
@@ -184,10 +189,10 @@ You can change the port number by creating two configuration files: a FluentD co
184189
auth.warning @127.0.0.1:%SYSLOG_PORT%
185190
```
186191

187-
* The syslog-ng config should be modified by copying the example configuration shown below and adding the custom modified settings to the end of the syslog-ng.conf configuration file located in `/etc/syslog-ng/`. Do **not** use the default label **%WORKSPACE_ID%_oms** or **%WORKSPACE_ID_OMS**, define a custom label to help distinguish your changes.
192+
* The syslog-ng config should be modified by copying the example configuration shown next and adding the custom modified settings to the end of the `syslog-ng.conf` configuration file located in `/etc/syslog-ng/`. Do *not* use the default label `%WORKSPACE_ID%_oms` or `%WORKSPACE_ID_OMS`. Define a custom label to help distinguish your changes.
188193

189194
> [!NOTE]
190-
> If you modify the default values in the configuration file, they will be overwritten when the agent applies a default configuration.
195+
> If you modify the default values in the configuration file, they'll be overwritten when the agent applies a default configuration.
191196
>
192197

193198
```config
@@ -196,10 +201,11 @@ You can change the port number by creating two configuration files: a FluentD co
196201
log { source(s_src); filter(f_custom_filter); destination(d_custom_dest); };
197202
```
198203

199-
After completing the changes, the Syslog and the Log Analytics agent service needs to be restarted to ensure the configuration changes take effect.
204+
After you finish the changes, restart the Syslog and the Log Analytics agent service to ensure the configuration changes take effect.
200205

201206
## Syslog record properties
202-
Syslog records have a type of **Syslog** and have the properties in the following table.
207+
208+
Syslog records have a type of **Syslog** and have the properties shown in the following table.
203209

204210
| Property | Description |
205211
|:--- |:--- |
@@ -213,16 +219,18 @@ Syslog records have a type of **Syslog** and have the properties in the followin
213219
| EventTime |Date and time that the event was generated. |
214220

215221
## Log queries with Syslog records
222+
216223
The following table provides different examples of log queries that retrieve Syslog records.
217224

218225
| Query | Description |
219226
|:--- |:--- |
220-
| Syslog |All Syslogs. |
221-
| Syslog &#124; where SeverityLevel == "error" |All Syslog records with severity of error. |
222-
| Syslog &#124; summarize AggregatedValue = count() by Computer |Count of Syslog records by computer. |
223-
| Syslog &#124; summarize AggregatedValue = count() by Facility |Count of Syslog records by facility. |
227+
| Syslog |All Syslogs |
228+
| Syslog &#124; where SeverityLevel == "error" |All Syslog records with severity of error |
229+
| Syslog &#124; summarize AggregatedValue = count() by Computer |Count of Syslog records by computer |
230+
| Syslog &#124; summarize AggregatedValue = count() by Facility |Count of Syslog records by facility |
224231

225232
## Next steps
233+
226234
* Learn about [log queries](../logs/log-query-overview.md) to analyze the data collected from data sources and solutions.
227-
* Use [Custom Fields](../logs/custom-fields.md) to parse data from syslog records into individual fields.
235+
* Use [custom fields](../logs/custom-fields.md) to parse data from Syslog records into individual fields.
228236
* [Configure Linux agents](../vm/monitor-virtual-machine.md) to collect other types of data.

0 commit comments

Comments
 (0)