# How to create pipeline definition from command line?

**URL:** <https://discuss.elastic.co/t/how-to-create-pipeline-definition-from-command-line/267139>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [March 13, 2021, 4:52am UTC](https://discuss.elastic.co/t/how-to-create-pipeline-definition-from-command-line/267139 "2021-03-13T04:52:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![YuWatanabe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuwatanabe/32/13259_2.png) [@YuWatanabe](https://discuss.elastic.co/u/YuWatanabe)\
**Post date:** [March 13, 2021, 4:52am UTC](https://discuss.elastic.co/t/how-to-create-pipeline-definition-from-command-line/267139/1 "2021-03-13T04:52:57Z")

</div>

I want to automate the process for preparing below pipeline. i.e by command line , api , etc  
This is because I want to send logs from filebeat _to logstash_ instead of sending directly _to elasticsearch_ .

```auto
GET _ingest/pipeline/filebeat-7.10.1-gsuite-drive-common
{
  "filebeat-7.10.1-gsuite-drive-common" : {
    "processors" : [
      {
        "geoip" : {
          "field" : "source.ip",
          "target_field" : "source.geo",
          "ignore_missing" : true
        }
      },
      {
        "geoip" : {
          "target_field" : "source.as",
          "properties" : [
            "asn",
            "organization_name"
          ],
          "ignore_missing" : true,
          "database_file" : "GeoLite2-ASN.mmdb",
          "field" : "source.ip"
        }
      },
      {
        "rename" : {
          "field" : "source.as.asn",
          "target_field" : "source.as.number",
          "ignore_missing" : true
        }
      },
      {
        "rename" : {
          "ignore_missing" : true,
          "field" : "source.as.organization_name",
          "target_field" : "source.as.organization.name"
        }
      },
      {
        "remove" : {
          "field" : "json",
          "ignore_missing" : true
        }
      },
      {
        "set" : {
          "field" : "event.ingested",
          "value" : "{{ _ingest.timestamp }}"
        }
      }
    ],
    "on_failure" : [
      {
        "set" : {
          "field" : "error.message",
          "value" : "{{ _ingest.on_failure_message }}"
        }
      }
    ],
    "description" : "Pipeline for parsing gsuite logs"
  }
}

```

Looks like the pipeline is related to filebeat version so if there are any tools or commands exists in the git repo , that will be great.

> **[elastic/beats](https://github.com/elastic/beats/tree/master/filebeat)**
>
> master/filebeat

Is there any tools which you can generate the _pipeline_ ?

---

<div class="post-metadata">

**Author:** ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)\
**Post date:** [March 15, 2021, 5:27pm UTC](https://discuss.elastic.co/t/how-to-create-pipeline-definition-from-command-line/267139/2 "2021-03-15T17:27:52Z")

</div>

Yes, I think what you are looking for is this: [Load ingest pipelines | Filebeat Reference [7.11] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/current/load-ingest-pipelines.html)

Shaunak

---

<div class="post-metadata">

**Author:** ![YuWatanabe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuwatanabe/32/13259_2.png) [@YuWatanabe](https://discuss.elastic.co/u/YuWatanabe)\
**Post date:** [March 22, 2021, 3:44am UTC](https://discuss.elastic.co/t/how-to-create-pipeline-definition-from-command-line/267139/3 "2021-03-22T03:44:30Z")

</div>

@shaunak  
thank you.

---

<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:** [April 19, 2021, 5:45am UTC](https://discuss.elastic.co/t/how-to-create-pipeline-definition-from-command-line/267139/4 "2021-04-19T05:45:24Z")

</div>

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