Support Questions
Find answers, ask questions, and share your expertise

Elasticsearch Queries

New Contributor

Using Nifi, it's possible to make this kind of request without destroy the original flowfile ?

curl -XPOST "http://localhost:9200/my_index/_search" -H 'Content-Type: application/json' -d'
{
  "query": {
    "bool": {
      "must": {
        "term": {
          "user.screen_name": "userName"
        }
      },
      "filter": {
        "range": {
          "date": {
            "gte": "now-3M",
            "lte": "now",
            "format": "EEE MMM dd HH:mm:ss Z YYYY"
          }
        }
      }
    }
  },
  "aggs": {
    "sum_RTs": {
      "sum": {
        "field": "retweetCount"
      }
    }
  }
}'

Thanks so much

1 REPLY 1

Rising Star

It is possible with a custom Processor, the out of the box processors supports query based on flowfile: https://community.hortonworks.com/questions/42727/using-invokehttp-flowfile-and-replacetext-from-nif...