Пример #1
0
 public void LoadMetricsToKusto(string sinkName, List <SentinelCostMetric> list)
 {
     try
     {
         var data   = new EnumerableDataReader <SentinelCostMetric>(list, sentinelCostMetricFields);
         var client = KustoIngestClients.FirstOrDefault(x => x.Name.Equals(sinkName));
         client?.IKustoIngestClient.IngestFromDataReader(data, client.KustoIngestionProperties);
     }
     catch (Exception ex)
     {
         Console.WriteLine($"LoadToLogFileKusto error: {ex}");
     }
 }
Пример #2
0
 public async void LoadDataToKusto(string sinkName, List <LogRecordSentinel> list)
 {
     try
     {
         var data   = new EnumerableDataReader <LogRecordSentinel>(list, eventLogFields);
         var client = KustoIngestClients.FirstOrDefault(x => x.Name.Equals(sinkName));
         await client?.IKustoIngestClient.IngestFromDataReaderAsync(data, client.KustoIngestionProperties);
     }
     catch (Exception ex)
     {
         Console.WriteLine($"LoadToLogFileKusto error: {ex}");
     }
 }