Splunk Search

How to capture the hits per day on LiveSite/OT servers??

mike000
New Member

Hey All,

Back again with another interesting question.

How do we get the number of hits per day for linux/livesite servers.

Example of the query:

(index=cloudfoundry or index=xxx_xxxx) sourcetype=access_xxxx_wcookie(/xx/xxx/content-adpater-webservice) AND (NOT- Pre NOT -Post) AND (status=200) AND (host=n or host= a or host=b or host=t or host=r or host=m)| stats count

Any help is appreciated.
Thanks,
Mike

Tags (2)
0 Karma
1 Solution

manjunathmeti
Champion

hi @mike000,

Try this:

(index=cloudfoundry or index=xxx_xxxx) sourcetype=access_xxxx_wcookie(/xx/xxx/content-adpater-webservice) AND (NOT- Pre NOT -Post) AND (status=200) AND (host=n or host= a or host=b or host=t or host=r or host=m) | bin _time span=1d | stats count by _time, host

View solution in original post

0 Karma

manjunathmeti
Champion

hi @mike000,

Try this:

(index=cloudfoundry or index=xxx_xxxx) sourcetype=access_xxxx_wcookie(/xx/xxx/content-adpater-webservice) AND (NOT- Pre NOT -Post) AND (status=200) AND (host=n or host= a or host=b or host=t or host=r or host=m) | bin _time span=1d | stats count by _time, host
0 Karma

mike000
New Member

Thanks Manjunath, it works 🙂 Appreciate it.

0 Karma

mike000
New Member

Hi Manjunath, I actually have one more question,

Its pulling the hits of the webservers, but its not pulling the hits on the livesite servers when I am changing the servernames in the queries from webserver to livesite server. Any ideas whats going on?

We use them for Content as a Service pull req.

0 Karma

manjunathmeti
Champion

Are livesite servers are part host filed? You added this filter on host field - host=n or host= a or host=b or host=t or host=r or host=m, does it includes livesite servers?

0 Karma

mike000
New Member

Hey Manjunath, yes I did replace the a,c,b, with our livesite servers

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Perhaps this will help.

(index=cloudfoundry or index=xxx_xxxx) sourcetype=access_xxxx_wcookie(/xx/xxx/content-adpater-webservice) AND (NOT- Pre NOT -Post) AND (status=200) AND (host=n or host= a or host=b or host=t or host=r or host=m)
| timechart span=1d count
---
If this reply helps you, Karma would be appreciated.
0 Karma

mike000
New Member

hey rich, thanks I tried it but it encountered some issue with the timechart. Maybe i messed something up 😛

0 Karma

mike000
New Member

I actually have one more question,

Its pulling the hits of the webservers, but its not pulling the hits on the livesite servers when I am changing the servernames in the queries from webserver to livesite server. Any ideas whats going on?

We use them for Content as a Service pull req.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Make sure all servers are using the one sourcetype or add more sourcetypes to your query.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...