Topic: AZ-104 topic 2 question 42

You have an Azure subscription named Subscription1 that contains an Azure Log Analytics workspace named Workspace1.
You need to view the error events from a table named Event.
Which query should you run in Workspace1?

A.
Get-Event Event | where {$_.EventType == "error"}
B.
Event | search "error"
C.
select * from Event where EventType == "error"
D.
search in (Event) * | where EventType ג€"eq ג€errorג€

Re: AZ-104 topic 2 question 42

B) 'Event | search "error"'

Reference: https://docs.microsoft.com/en-us/azure/azure-monitor/logs/log-analytics-tutorial

Re: AZ-104 topic 2 question 42

Agree. Found another reference too:
https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/searchoperator?pivots=azuredataexplorer

Re: AZ-104 topic 2 question 42

Repeated question Topic2.Question22

Correct answer B

Re: AZ-104 topic 2 question 42

B is correct

Re: AZ-104 topic 2 question 42

I passed with these questions and many friends passed too, all questions appeared in the real exam a great study resource, contact me on [email protected]

Re: AZ-104 topic 2 question 42

The correct query to view error events from a table named "Event" in Azure Log Analytics workspace is:

C. select * from Event where EventType == "error"

This query will retrieve all the records from the "Event" table where the EventType is equal to "error," allowing you to view only the error events.

Re: AZ-104 topic 2 question 42

That's not valid KQL, try it with this sample code
let MyInMemoryTable = datatable(EventType: string, EventMessage: string, EventTime: datetime)
[
    "error", "Something bad occurred in the application.", datetime(2024-01-09T13:00:00),
    "warning", "A warning was logged by the application, be careful of error", datetime(2024-01-09T14:00:00),
    "info", "Informational message from the application.", datetime(2024-01-09T15:00:00),
    "error", "Oh noes occurred in the application.", datetime(2024-01-09T16:00:00)
];
SELECT * FROM (MyInMemoryTable) where EventType == "error"

Re: AZ-104 topic 2 question 42

Event
| where SeverityLevel == "Error"
Correct Answer: B

Re: AZ-104 topic 2 question 42

C. select * from Event where EventType == "error"

To view the error events from a table named Event in the Azure Log Analytics workspace named Workspace1, you should run the query:
select * from Event where EventType == "error"

This query selects all the columns (*) from the Event table where the EventType is equal to "error". It will retrieve all the error events from the Event table in Workspace1.

The other options provided are not valid for querying data in Azure Log Analytics. They do not use the correct syntax or functions for querying data in Log Analytics.

Re: AZ-104 topic 2 question 42

select * from Event where EventType == "error" is an example of SQL (Structured Query Language) whereas Log Analytics uses KQL (Kusto Query Language). The correct answer is B

Re: AZ-104 topic 2 question 42

B - Tested in lab (Event | search "error")

Re: AZ-104 topic 2 question 42

Correct Answer: B

Re: AZ-104 topic 2 question 42

Event | search "error"

Re: AZ-104 topic 2 question 42

Correct Answer: B

Re: AZ-104 topic 2 question 42

Correct Answer: B