How can i add two fields which contains string value and store it in a new field

For ex:
name: Vishnu
surname_filed : mk

I want a to combine this to filed and in a new field

Name: Vishnu mk

filter {
mutate {
add_field => { "new_field" => "%{name} %{surname}" }
}
}

this should work. or you look at the mutate filter and have a look at the great options. maybe there is something thats suites you better. like the merge option.
https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html

How can i add field in ingest pipeline:
PUT ingest/pipeline/abc7
{
"description" : "fscrawler res2",
"processors" : [
{
"grok": {
"field": "content",
"patterns": ["(^|\s)(?(\+\d{1,3}[- ]?)?\d{10})($|\s)"]
}
},
{
"grok": {
"field": "path.virtual",
"patterns": ["%{DATA:name1} %{DATA:surname}\
%{GREEDYDATA:remaining}"]
}
}

]

This is my code i want to murge name1 and surname filed

You are talking about elasticsearch and not logstash.

But have a look at this.
https://www.elastic.co/guide/en/elasticsearch/reference/current/accessing-data-in-pipelines.html

there you can access fields with the set parameter.

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