HTTPJson Input Request Transforms

Im trying to create a custom input for:

I can get it to produce events fine with the following config:

- type: httpjson
  config_version: 2
  interval: 1h
  request.url: https://services.nvd.nist.gov/rest/json/cves/1.0
  request.transforms:
  - set:
      target: url.params.resultsPerPage
      value: '2000'
  response.split:
   target: body.result.CVE_Items

how ever i want to set the "modStartDate" parameter to be the last hour, from my understanding this should be able to be done however i cant workout the golang templating i need, when i try and set the modStartDate with [[ formatDate (now) "yyyy-MM-dd ''T'HH:mm:ss:sss z"]] i get a 404 response however if i set the date with a fixed value of '2019-01-01 T00:00:00:000 UTC05:00' it works fine. I've tried just setting the year with the formatDate option and its still not work.

 - set:
      target: url.params.modStartDate
      value: '[[ formatDate (now) "yyyy"]]-07-14T00:00:00:000 UTC-00:00'

Am i making a silly mistake is anyone able to help on what the issue might be? id rather use Filebeat than a python script for this. :smiley:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.