简体   繁体   English

没有传入事件中心的消息

[英]No incoming messages to Event Hub

Couldn't see the incoming messages coming through from Azure AD logs into Azure Event Hub.无法看到从 Azure AD 日志传入 Azure 事件中心的传入消息。 I have followed the below article.我已经关注了下面的文章。

https://docs.microsoft.com/en-us/azure/active-directory/reports-monitoring/tutorial-azure-monitor-stream-logs-to-event-hub https://docs.microsoft.com/en-us/azure/active-directory/reports-monitoring/tutorial-azure-monitor-stream-logs-to-event-hub

Can someone please let me know if there's anything I missed here.如果我在这里遗漏了什么,有人可以告诉我。

Below are the images下面是图片

AAD configuration to stream logs to Event Hub将日志流式传输到事件中心的 AAD 配置

No incoming messages in Azure Event hub Azure 事件中心中没有传入消息

I tried to read messages using Azure portal tools, but in the end I ended up doing it with DataBricks, or Python, depending on the situation.我尝试使用 Azure 门户工具读取消息,但最终我根据情况使用 DataBricks 或 Python 来完成它。

https://docs.microsoft.com/en-us/azure/databricks/spark/latest/structured-streaming/streaming-event-hubs https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-python-get-started-send https://docs.microsoft.com/en-us/azure/databricks/spark/latest/structured-streaming/streaming-event-hubs https://docs.microsoft.com/en-us/azure/event-hubs /event-hubs-python-get-started-send

It's very simple (DataBricks scala example):这非常简单(DataBricks scala 示例):

import org.apache.spark.eventhubs.{ConnectionStringBuilder, EventHubsConf, EventPosition}
import org.apache.spark.sql.functions._
import java.time.{Clock, Instant}
import java.time.temporal.ChronoUnit;
import org.apache.spark.sql._



//number of hours you want to display
val hoursToDisplay = 24




 val ehConf = EventHubsConf(yourConnectionString)
        .setStartingPosition(EventPosition.fromEnqueuedTime(Instant.now.minus(hoursToDisplay,ChronoUnit.HOURS)))
          .setConsumerGroup(yourConsumerName)




val input = spark.read.
          format("eventhubs").
          options(ehConf.toMap).
          load().
          select($"*" , $"body".cast("string").as("string_Casted_Body"))

display(input)

Hope it helps希望能帮助到你

Seems there is some expected delay.似乎有一些预期的延迟。 Azure AD recommends to wait about 15 minutes before checking things on the Event Hubs side. Azure AD 建议等待大约 15 分钟,然后再检查事件中心端的内容。 Did you wait for enough time?你等的时间够长了吗?

After about 15 minutes, verify that events are displayed in your event hub.大约 15 分钟后,验证事件是否显示在您的事件中心。 To do so, go to the event hub from the portal and verify that the incoming messages count is greater than zero.为此,请从门户转到事件中心并验证传入消息计数是否大于零。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM