As the title implies, I am trying to get my logger table data via an automation script.
My setup contains a remote TLS-enabled elastic database and a single DataMiner agent. This agent runs an element with a driver that fills up an elastic logger table.
Now for my use case I want to fetch this data and loop over it in order to do some actions based on what type of data it is.
How do I fetch this data via an automation script?
Hi,
There are open-source Nuget Packages available that you can use in an Automation Script which enables you to directly query your ElasticSearch database. Note that it is important to check the compatibility with the ElasticSearch version your database is running on. If you are for example still on the supported 6.8 version that DataMiner is supporting, I would recommend to use the NEST client 7.17.5 (NuGet Gallery | NEST 7.17.5 ). For another user, this Nuget package worked fine to do queries on an ElasticSearch Database running version 6.8.0.
The code to initialize the client will look like this, where the ElasticURI is the URL and port to your elastic cluster (the same as you need to check the status of your database when setting up a connection with ElasticVue )
var connectionPool = new SingleNodeConnectionPool(new Uri(ElasticURI));
var settings = new ConnectionSettings(connectionPool);
var elasticClient = new ElasticClient(settings);
If you would already use an OpenSearch database as your indexing database, I think this client could help you further (opensearch-project/opensearch-net: OpenSearch .NET Client (github.com) ) but this I did not try it out myself.
Kind regards,
Joachim