Getting Data In

extracting ip details from apache logs

adriangoodhead7
Explorer

Hi all, i'm new to splunk. I've managed to get it set up and imported a load of Apache log files. When I search by host, it shows all the logs but I can't quite work out the next step.

Ultimately I would like to produce a chart/graph of the number of times an ip address appers in the events, and splunk has correctly identified the date/time stamp, and sorted accordingly. I can see the ip addresses in the event (, but can't work out how to get the data into a graph format.

There doesn't seem to be a IP address field, how do I use splunk to extract the IP addresses from the logs?

I'm sure this is quite a basic thing to do, i'll continue my research online.

Thanks.

Tags (2)
0 Karma
1 Solution

adriangoodhead7
Explorer

I changed the source type to "access_combined" and now its sorted, thanks 😉

View solution in original post

adriangoodhead7
Explorer

I changed the source type to "access_combined" and now its sorted, thanks 😉

somesoni2
Revered Legend

You can include following in your search to extract the IP address at search time and use this field in your charting search.

your base search| rex  "(?<IP_address>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})" | your chart search using field IP_address
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Take a look at the search tutorial: http://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/WelcometotheSearchTutorial

These kinds of questions are answered and explained there, even using access logs as an example.

0 Karma

adriangoodhead7
Explorer

Here is an entry from splunk

65.55.52.111 - - [18/Nov/2013:20:50:42 -0700] "GET acme.com/~fb872661/ HTTP/1.1" 200 6374 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)" 0 "redirect-handler" "/var/chroot/home/content/20/11043820/html/index.php" 228881
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...