How to filter IP from a log file using Logstash?

0 votes

Hi Guys,

I am to retrieve IP from my webserver log file using Logstash. Can anyone help me how can I do this?

Jun 18 in DevOps Tools by akhtar
• 18,250 points
37 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use the filter plugin in Logstash. It will help you to retrieve particular data. There are lots of inbuilt Regex available. To find the IP address, IP Regex is available. I have attached one example below.

filter {
  grok {
  match => [ "message", "%{IP:myclientIP}" ]
  }
}

I hope this will help you.

answered Jun 18 by MD
• 42,420 points

Related Questions In DevOps Tools

0 votes
1 answer
0 votes
1 answer

What are the steps to permanently remove a committed file from the repository?

To remove a file for example 'myfile.txt'; ...READ MORE

answered Nov 26, 2019 in DevOps Tools by Sirajul
• 55,620 points
62 views
0 votes
1 answer
0 votes
1 answer
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,420 points
602 views
0 votes
1 answer
0 votes
1 answer

How to connect log file as an input in Logstash?

Hi@akhtar, You can use the file plugin to ...READ MORE

answered Jun 17 in DevOps Tools by MD
• 42,420 points
30 views
0 votes
1 answer

How to send email notification using Logstash?

Hi@akhtar, You can use the Email plugin in ...READ MORE

answered Jun 18 in DevOps Tools by MD
• 42,420 points
39 views