EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login
Home Data Science Data Science Tutorials Logstash Tutorial Logstash mutate
Secondary Sidebar
Logstash Tutorial
  • Basic
    • What is Logstash?
    • Kibana Logstash
    • Logstash Alternatives
    • Logstash if field exists
    • Logstash Test Config
    • Logstash Date Filter
    • Logstash Version
    • Logstash Filter
    • Logstash Pipeline
    • Logstash Port
    • Logstash Filter JSON
    • Logstash JDBC
    • Logstash Timestamp
    • Logstash Multiline
    • Logstash split
    • Logstash Codec
    • Logstash HTTP input
    • Logstash Filebeat
    • Logstash if
    • Logstash File Input
    • Logstash mutate
    • Logstash Syslog
    • Logstash AWS
    • Logstash.yml
    • Logstash Install Plugin
    • Logstash Geoip
    • Logstash add field
    • Logstash Multiple Pipelines
    • Logstash TCP input
    • Logstash Multiple Outputs
    • Logstash Stdout
    • Logstash Pipeline Configuration
    • Logstash Monitoring
    • LogstashEncoder
    • Logstash CSV
    • Logstash Cluster
    • Logstash Debug

Logstash mutate

Logstash mutate

Introduction to Logstash mutate

The Logstash mutate is defined as the mutate is the filter in logstash. It can allow us to accomplish general mutations on fields like it can rename, remove, replace, and modify the fields in our events. We can say that the filters in the logstash will allow us to constrain the fields into a particular type of data. It can also allow adding, copy, and updating the fields to assemble them compatible beyond the environment. This filter and its various configurations have been described in a section which can be the configuration file in the logstash.

What is Logstash mutate?

The mutate filter has been constructed into Logstash; it has a specific command for verification; the mutate filter with its various configuring options has been described in the section of a configuration file. In the filter section, the fields of the upcoming events can be converted and proceeds. The output section will provide the analyzed data; various options can be used with the mutate filter in such a way it can copy fields. It can rename the fields; it can also make the letters uppercase and lowercase; it also does the rename, join, and so on. The mutate filter in the Logstash can have its own order of sorting, and it can also allow to personalized the order by configuring the blocks of it.

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

Logstash mutates filters

Given below are the different filters of Logstash mutate:

  • add_field

This is a type of field which we can say that it is an option for a filter which has the ‘hash’ value type, it has default value {}, by using this option or field, we can able to add a new field to the event, if this filter is successful then it allows to add any field in the event in random order, the field name can be dynamic and, in this filter, we can able to add multiple fields at one time.

Logstash mutate output 1

  • add_tag

By using this configuration option, we can able to add any label to the event; it has an ‘array’ value type and no default value for this setting; if this filter gets successful, then it allows to add of a new tag to the event in random order, the tags may be dynamic, and it can take part in the event with the help of the % {} field.

Logstash mutate output 2

  • convert

This is another filter that can convert a value of a field into a different type; for example, it can convert a string into an integer, it has value type ‘hash,’ but it does not have any default value for a setting; it can convert all members when the field value is an array on the other hand if the field value is ‘hash,’ and then there is no need to take a step, the valid target for it are string, float, and integer.

Logstash mutate output 3

  • gsub

It has value type ‘array,’ it does not have a default value for a setting, with the help of systematic expressions, it can transform the string field, and if the field is not a string, then it will not perform any action, it takes action when an array contains 3 elements for every field.

Logstash mutate output 4

  • join

The join is an array type filter that can have a separate character in which it cannot work on the non-array fields, has a ‘hash’ value type, and does not have any default value for the setting.

Logstash mutate output 5

  • lowercase

The ‘lowercase’ filter can transform a string into its lowercase equivalent; it has an ‘array’ value type and does not have a default value.

Logstash mutate output 6

  • merge

It has a ‘hash’ value type, it does not have a default value, in which it can merge two fields of an array, it can convert string field into an array involuntarily when we use array and string then it will convert to string and string, and the result will be two arrays.

Logstash mutate output 7

  • remove_field

It has an ‘array’ value type with ‘[]’ as a default value; if the given filter is successful, then it can remove the field from an event at random order, which may have a dynamic field name.

Logstash mutate output 8

  • remove_tag

It has an ‘array’ value type in which it has ‘[ ]’ default value, if the given filter gets successful, then it can remove the tag from an event randomly, the tags may be dynamic, and the chunk of the event can be like % {} in syntactically.

output 9

  • rename

This is also a field that can be used with a mutate filter that has a ‘hash’ value type and it does not have the default value for a setting; it can be renamed one or more fields.

output 10

  • replace

This filter can have a ‘hash’ value type, and there is no default value that has been used for setting; it can able to replace the field with a new value, the new value can have %{} syntax, and it can construct the new value from another part of the event.

 output 11

  • split

It has a ‘hash’ value type and no default value; it can split a field into an array with the help of a special character, it can work with string fields only.

output 12

  • strip

It has an ‘array’ value type in which there is no default value available for a setting that can work with main whitespaces.

output 13

  • update

It can able to update the present field with a new value; if there is no field available, then it will not work; it has a ‘hash’ value type.

output 14

  • uppercase

It can transform the string into an uppercase equivalent with an ‘array’ value type with no default value.

output 15

Conclusion

In this article, we conclude that with the help of mutating filter, we can able to carry out different types of operations on the specific fields; we have also discussed the fields which are available in the mutate filter in this way, we have also seen the definition of mutating in the logstash.

 Recommended Articles

This is a guide to Logstash mutate. Here we discuss the help of mutating filters we can able to carry out different types of operations on the specific fields. You may also have a look at the following articles to learn more –

  1. What is Logstash?
  2. Logstash Alternatives
  3. Logstash Version
  4. Kibana Logstash
Popular Course in this category
Kibana Training (1 Course, 3 Project)
  1 Online Courses |  3 Hands-on Project |  14+ Hours |  Verifiable Certificate of Completion
4.5
Price

View Course
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2023 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more