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}"); } }
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}"); } }