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
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!

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 ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...