none
Elastic Search Output RRS feed

  • Question

  • Hi Experts, 

    I have a table that will consist of a no of queries that will be executed using a windows service running in background. Am new to C# and trying to determine a way how can I push the output of these queries directly into Elastic Search. 

    Like in Powershell we can use the piping operator to feed out the output. Do we need to create individual data table objects in C# to store the output of the queries executed on SQL Server before passing it to Elastic Search.

    Challenge

    As the count of queries is dynamic. I may get different queries with different attributes as request to be executed on SQL Server and load the output into Elastic Search. 

    Kindly assist.

    SQL Server 1 Column1 Column2 Column3
      SQL_Server_Instance Query Frequency (Sec)
      Local_Host_1 SELECT 1 FROM Table_1 3
      Local_Host_1 SELECT Columns FROM Table_2 4
      Local_Host_2 SELECT Columns FROM Table_2 2
      Local_Host_3 SELECT Columns FROM Table_2 5


    • Edited by Priya Bange Monday, October 28, 2019 4:27 AM .
    Monday, October 28, 2019 4:27 AM

All replies

  • This is a question about Elasticsearch.  You need to understand their API in order to know how to ship data into it, and how to format that data.  It might be easier to create a DataTable to perform the individual queries, or there might be a more generic method.

    We can't help you with the organization of your data.  Like most computing problems, you need to write down "what information do I have", and "what information do I need".  Once you have that, you should be able to write code to move from the first to the second.


    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Monday, October 28, 2019 5:41 PM
  • Hi Priya Bange,

    Thank you for posting here.

    Based on my search, it seems that Elastic search comes from java. Therefore, I think you may get few answers in c# forum.

    However, I find the following link may be helpful for you to use Elastic search in c#.

    Getting Started With ElasticSearch

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, October 29, 2019 6:27 AM
    Moderator