Skip to content

Commit cf889f9

Browse files
committed
replace variables
1 parent eb9f323 commit cf889f9

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

articles/azure-monitor/logs/tutorial-logs-ingestion-code.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ The following sample code uses the [Azure Monitor Ingestion client library for J
187187
- AZURE_CLIENT_ID
188188
- AZURE_CLIENT_SECRET
189189
190-
3. Replace the variables in the following sample code with values from your DCE, and DCR. Use *Custom-MyTableRawData* for the `data_stream_name` to match the DCR in the tutorial. You might also want to replace the sample data with your own.
190+
3. Replace the variables in the following sample code with values from your DCE, and DCR. You might also want to replace the sample data with your own.
191191
192192
```javascript
193193
const { isAggregateLogsUploadError, DefaultAzureCredential } = require("@azure/identity");
@@ -196,9 +196,9 @@ The following sample code uses the [Azure Monitor Ingestion client library for J
196196
require("dotenv").config();
197197
198198
async function main() {
199-
const logsIngestionEndpoint = process.env.LOGS_INGESTION_ENDPOINT || "logs_ingestion_endpoint";
200-
const ruleId = process.env.DATA_COLLECTION_RULE_ID || "data_collection_rule_id";
201-
const streamName = process.env.STREAM_NAME || "data_stream_name";
199+
const logsIngestionEndpoint = "https://logs-ingestion-rzmk.eastus2-1.ingest.monitor.azure.com";
200+
const ruleId = "dcr-00000000000000000000000000000000";
201+
const streamName = "Custom-MyTableRawData";
202202
const credential = new DefaultAzureCredential();
203203
const client = new LogsIngestionClient(logsIngestionEndpoint, credential);
204204
const logs = [
@@ -279,13 +279,13 @@ The following sample code uses the [Azure Monitor Ingestion client library for J
279279
- AZURE_CLIENT_ID
280280
- AZURE_CLIENT_SECRET
281281
282-
4. Replace the variables in the following sample code with values from your DCE, and DCR. Use *Custom-MyTableRawData* for the `<data-stream-name>` to match the DCR in the tutorial. You may also want to replace the sample data with your own.
282+
4. Replace the variables in the following sample code with values from your DCE, and DCR. You may also want to replace the sample data with your own.
283283
284284
```java
285285
public static void main(String[] args) {
286286
287287
LogsIngestionClient client = new LogsIngestionClientBuilder()
288-
.endpoint("<data-collection-endpoint>")
288+
.endpoint("https://logs-ingestion-rzmk.eastus2-1.ingest.monitor.azure.com")
289289
.credential(new DefaultAzureCredentialBuilder().build())
290290
.buildClient();
291291
@@ -314,7 +314,7 @@ The following sample code uses the [Azure Monitor Ingestion client library for J
314314
});
315315
316316
try {
317-
client.upload("<data-collection-rule-id>", "<data-stream-name>", dataList);
317+
client.upload("dcr-00000000000000000000000000000000", "Custom-MyTableRawData", dataList);
318318
System.out.println("Logs uploaded successfully");
319319
} catch (LogsUploadException exception) {
320320
System.out.println("Failed to upload logs ");
@@ -346,15 +346,15 @@ The following script uses the [Azure Monitor Ingestion client library for .NET](
346346
- AZURE_CLIENT_ID
347347
- AZURE_CLIENT_SECRET
348348
349-
2. Replace the variables in the following sample code with values from your DCE, and DCR. Use *Custom-MyTableRawData* for the `data_stream_name` to match the DCR in the tutorial. You may also want to replace the sample data with your own.
349+
2. Replace the variables in the following sample code with values from your DCE, and DCR. You may also want to replace the sample data with your own.
350350
351351
352352
353353
```csharp
354354
// Initialize variables
355-
var endpoint = new Uri("<data_collection_endpoint_uri>");
356-
var ruleId = "<data_collection_rule_id>";
357-
var streamName = "<data_stream_name>";
355+
var endpoint = new Uri("https://logs-ingestion-rzmk.eastus2-1.ingest.monitor.azure.com";);
356+
var ruleId = "dcr-00000000000000000000000000000000";
357+
var streamName = "Custom-MyTableRawData";
358358
359359
// Create credential and client
360360
var credential = new DefaultAzureCredential();

0 commit comments

Comments
 (0)