Getting Data In

how to configure inputs.conf?

khandelwaly
Explorer

i have logs like this :

-rw-r----- 1 jira jira 4921534 Apr 13 22:42 catalina.2020-04-13.log
-rw-r----- 1 jira jira 463769261 Apr 14 00:00 access_log.2020-04-13
-rw-r----- 1 jira jira 2840014 Apr 14 13:08 catalina.2020-04-14.log
-rw-r----- 1 jira jira 222675515 Apr 14 13:08 access_log.2020-04-14

How to configure inputs.conf for the access_log
I tried below but it didnot work

[monitor:////apps/logs/access_log]
index = prdidx
blacklist = .(gz)$
sourcetype = ACCESS
_TCP_ROUTING = WEB

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try

[monitor:///apps/logs/access_log/access_log.*]
---
If this reply helps you, Karma would be appreciated.
0 Karma

khandelwaly
Explorer

logs file name is access_log.2020-04-14. No folder with name access_log.
Tried without access_log folder as well but it didnot work

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Did you restart the forwarder after changing inputs.conf?
Does Splunk have read access to the logs?
Do the files appear in the output of the CLI command splunk list monitor?

---
If this reply helps you, Karma would be appreciated.
0 Karma

PavelP
Motivator

if splunk runs as not root user then you have to add splunk to jira group, here is an example if splunk(forwarder) runs as a splunk user:

usermod -a -G jira splunk
0 Karma

khandelwaly
Explorer

Splunk restart is fine. Only files under the mentioned directory is not shown on Splunk. Need help to configure the inputs.conf

0 Karma

PavelP
Motivator

Does splunk run as a root user?

0 Karma

khandelwaly
Explorer

yes it run as root.

0 Karma

to4kawa
Ultra Champion
# The following configuration reads all the files in the directory /var/log.

[monitor:///var/log]

there is too many /

https://docs.splunk.com/Documentation/Splunk/latest/Admin/Inputsconf

0 Karma

khandelwaly
Explorer

I removed the / but still the same thing. I don't want to read all the files in that directory. I want to only read access_log

0 Karma

khandelwaly
Explorer

Tried below but still failing
[monitor:///apps/logs/]
index = prdidx
blacklist = \.(gz)$
whitelist = access_log\.*$
sourcetype =ACCESS
_TCP_ROUTING = WEB

0 Karma

to4kawa
Ultra Champion

blacklist = .(gz)$

whitelist = \.log$
How about this?

0 Karma

khandelwaly
Explorer

Files are not ending with .log. Tried _log but did not work

0 Karma

to4kawa
Ultra Champion

what's your sourcetype now?

0 Karma

to4kawa
Ultra Champion
0 Karma

to4kawa
Ultra Champion

and check sourcetype

0 Karma

richgalloway
SplunkTrust
SplunkTrust

What is the full path of the log files shown?

---
If this reply helps you, Karma would be appreciated.
0 Karma

khandelwaly
Explorer

files are under /apps/logs/

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...