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.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting V2

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...