Question

how to transform multi-line json to one line valid query that can be used through FME transformes:

  • 28 May 2019
  • 1 reply
  • 2 views

I can not just copy the curl command from kibana and paste it into the FME transformer. Can you please provide me helpful sites, links, where i can learn how to tone it down to one liner query to use in FME transformers?

For example, in kibana console, the following code gives me the documents that matches company_name=shell. But, if I need the same result in FME, i have to use FeatureReaders/httpcaller/elasticReader with the query: GET /prod_gffp_filings/_search?q=COMPANY_NAME:chevron

 

 

GET prod_gffp_filings/_search?pretty

{

"query": {

"match": {

"COMPANY_NAME": "Shell"

}

}

}


1 reply

Badge +6

Hi @zatom,

You should be able to use a JSON Query very similar to what you send through the kibana console directly within the ElasticSearch Reader in FME. Here's a link to the documentation that shows where to set that:

 

http://docs.safe.com/fme/2019.0/html/FME_Desktop_Documentation/FME_ReadersWriters/elasticsearch/elasticsearch-ft-param-r.htm

 

 

In your case, you should be able to add a query like:

{

"query": {

"match": {

"COMPANY_NAME": "Shell"

}

}

}

 

directly in that parameter.

Hope that helps!

 

 

Reply