# Adding data after csv filter from rest api using http filter

**URL:** <https://discuss.elastic.co/t/adding-data-after-csv-filter-from-rest-api-using-http-filter/310241>\
**Category:** Logstash\
**Created:** [July 21, 2022, 7:05am UTC](https://discuss.elastic.co/t/adding-data-after-csv-filter-from-rest-api-using-http-filter/310241 "2022-07-21T07:05:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikhatanu](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@mikhatanu](https://discuss.elastic.co/u/mikhatanu)\
**Post date:** [July 21, 2022, 7:05am UTC](https://discuss.elastic.co/t/adding-data-after-csv-filter-from-rest-api-using-http-filter/310241/1 "2022-07-21T07:05:56Z")

</div>

Hello, i have 2 file: csv and json. i wanted to read the json file to get access token.  
here is my config:

```auto
input {
  # Open csv from path
  file{
    path =>["/some/path/log/*.csv"]
  }
}

filter{
  # Parse csv input  
  csv{
      columns => [
      "Local_IP",
      "Local_Port",
      "Remote_IP",
      "Remote_Port",
      "Protocol",
      "First_Seen_At",
      ]
      separator=>','
      skip_header => true  
  }
  date{
      match => ["First_Seen_At", "UNIX_MS"]
  }
  
  # Call rest api using "Remote_IP" field
  http{
    url => "https://www.example.com/api/%{Remote_IP}"
    verb => GET
    target_body => some_body
    headers => {
      "Authorization" => "Bearer %{accessToken}" }
  }

output {
}

```

I want to load the json file and set %{accessToken} field. How do i do this?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 18, 2022, 7:06am UTC](https://discuss.elastic.co/t/adding-data-after-csv-filter-from-rest-api-using-http-filter/310241/2 "2022-08-18T07:06:51Z")

</div>

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