Comments (24)
For anybody interested : one cause of this is that you need 755 permissions on the entire path.
so if you tail logs that are on /home/ec2-user/something
you need 755 for /home
for ec2-user
etc'
from amazon-kinesis-agent.
I had to touch
each of the files I wanted it to stream, even though I designated START_OF_FILE
as the initial position.
from amazon-kinesis-agent.
And here is the logs for the agent:
2016-07-15 11:20:49.296-0500 axil7 (Agent.MetricsEmitter RUNNING) com.amazon.kinesis.streaming.agent.Agent [INFO] Agent: Progress: 0 records parsed (0 bytes), and 0 records sent successfully to destinations. Uptime: 810029ms
2016-07-15 11:21:19.295-0500 axil7 (FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/.json].MetricsEmitter RUNNING) com.amazon.kinesis.streaming.agent.tailing.FileTailer [INFO] FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/.json]: Tailer Progress: Tailer has parsed 0 records (0 bytes), transformed 0 records, skipped 0 records, and has successfully sent 0 records to destination.
2016-07-15 11:21:19.296-0500 axil7 (Agent.MetricsEmitter RUNNING) com.amazon.kinesis.streaming.agent.Agent [INFO] Agent: Progress: 0 records parsed (0 bytes), and 0 records sent successfully to destinations. Uptime: 840029ms
from amazon-kinesis-agent.
Hi @cf1497 looking at your log, the FileTailer was tailing this file:
/usr2/cheng/tomahawk-server/logs/.json
which seems invalid.
Could you verify your filePattern in the config file? Or double check files under that directory?
from amazon-kinesis-agent.
Hi @chaochenq , thanks for your respond.
I just double checked the fileParttern, it is "/*.json", and then I replaced it with a specific file name under that directory, however the problem still happened.
Thanks!
from amazon-kinesis-agent.
If there's a star in the config file, the FileTailer should look like FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/*.json] rather than FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/.json]
Did you do a restart?
from amazon-kinesis-agent.
Hi @chaochenq ,
I restarted it several times, and I double checked the logs, it has a start in the config file.
2016-07-15 12:18:43.556-0500 axil7 (FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/.json].MetricsEmitter RUNNING) com.amazon.kinesis.streaming.agent.tailing.FileTailer [INFO] FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/.json]: Tailer Progress: Tailer has parsed 0 records (0 bytes), transformed 0 records, skipped 0 records, and has successfully sent 0 records to destination.
2016-07-15 12:18:43.557-0500 axil7 (Agent.MetricsEmitter RUNNING) com.amazon.kinesis.streaming.agent.Agent [INFO] Agent: Progress: 0 records parsed (0 bytes), and 0 records sent successfully to destinations. Uptime: 2640029ms
Thanks!
from amazon-kinesis-agent.
That's weird... just by looking at your log, it looks like the Agent is ignoring the star in the configuration. You may want to add some debug messages here:
from amazon-kinesis-agent.
It is very weird, I can see the start in my config file and log file, but not here.
Thanks, I will add some debug messages to see what happened.
Here is the log that I used a specific file name :
2016-07-15 12:20:06.540-0500 axil7 (FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-13.json].MetricsEmitter RUNNING) com.amazon.kinesis.streaming.agent.tailing.FileTailer [INFO] FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-13.json]: Tailer Progress: Tailer has parsed 0 records (0 bytes), transformed 0 records, skipped 0 records, and has successfully sent 0 records to destination.
from amazon-kinesis-agent.
Ok a few questions:
- Are you actively writing data to the file (tomahawk_2016-07-13.json)
- If not, you may want to add "initialPosition" : "START_OF_FILE" to the config. Otherwise agent will always tail from the end by default.
See http://docs.aws.amazon.com/firehose/latest/dev/writing-with-agents.html#config-start
from amazon-kinesis-agent.
Hi,
- I double checked the file, it has data in it, and the data looks like:
{"timestamp":"......", "message":"......"} - I tried to add "initialPosition":"START_OF_FILE", however it didn't help.
Thanks!
from amazon-kinesis-agent.
You can add "log.level" : "DEBUG" or "log.level" : "TRACE" to see if the tail moves forward, or any state change that breaks the tail.
from amazon-kinesis-agent.
Hi,
I just changed the log.level to Trace, then I got these logs:
2016-07-15 13:16:10.439-0500 axil7 (FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]) com.amazon.kinesis.streaming.agent.tailing.FileTailer [DEBUG] FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]: No checkpoints were found. Looking for new files to tail...
2016-07-15 13:16:10.443-0500 axil7 (AsyncPublisher[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]) com.amazon.kinesis.streaming.agent.tailing.AsyncPublisherService [DEBUG] AsyncPublisher[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]: Starting up...
2016-07-15 13:16:10.443-0500 axil7 (AsyncPublisher[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]) com.amazon.kinesis.streaming.agent.tailing.AsyncPublisherService [TRACE] AsyncPublisher[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]: Main loop started
2016-07-15 13:16:10.443-0500 axil7 (FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]) com.amazon.kinesis.streaming.agent.tailing.FileTailer [TRACE] FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json] is refreshing current tailed file.
2016-07-15 13:16:10.443-0500 axil7 (FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]) com.amazon.kinesis.streaming.agent.tailing.FileTailer [TRACE] FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]: There's no file being tailed.
Thanks!
from amazon-kinesis-agent.
Only these are not sufficient for me to troubleshoot. I'd recommend going over the log more and tracking the tailing progress.
from amazon-kinesis-agent.
Hi,
I just restart it, and here is the log:
2016-07-15 13:28:56.773-0500 axil7 (main) com.amazon.kinesis.streaming.agent.Agent [INFO] Reading configuration from file: /etc/aws-kinesis/agent.json
2016-07-15 13:28:56.807-0500 axil7 (main) com.amazon.kinesis.streaming.agent.Agent [INFO] null: Agent will use up to 288 threads for sending data.
2016-07-15 13:28:56.816-0500 axil7 (main) com.amazon.kinesis.streaming.agent.tailing.checkpoints.SQLiteFileCheckpointStore [DEBUG] Connecting to database /var/run/aws-kinesis-agent/checkpoints...
2016-07-15 13:28:56.942-0500 axil7 (main) com.amazon.kinesis.streaming.agent.tailing.checkpoints.SQLiteFileCheckpointStore [INFO] Deleted 0 old checkpoints.
2016-07-15 13:28:56.954-0500 axil7 (Agent STARTING) com.amazon.kinesis.streaming.agent.Agent [INFO] Agent: Starting up...
2016-07-15 13:28:56.961-0500 axil7 (Agent STARTING) com.amazon.kinesis.streaming.agent.Agent [INFO] Agent: Starting tailer for file fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json
2016-07-15 13:28:56.978-0500 axil7 (FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]) com.amazon.kinesis.streaming.agent.tailing.FileTailer [DEBUG] FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]: Starting up...
2016-07-15 13:28:56.979-0500 axil7 (FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]) com.amazon.kinesis.streaming.agent.tailing.FileTailer [DEBUG] FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]: No checkpoints were found. Looking for new files to tail...
2016-07-15 13:28:56.982-0500 axil7 (AsyncPublisher[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]) com.amazon.kinesis.streaming.agent.tailing.AsyncPublisherService [DEBUG] AsyncPublisher[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]: Starting up...
2016-07-15 13:28:56.983-0500 axil7 (AsyncPublisher[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]) com.amazon.kinesis.streaming.agent.tailing.AsyncPublisherService [TRACE] AsyncPublisher[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]: Main loop started
2016-07-15 13:28:56.983-0500 axil7 (FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]) com.amazon.kinesis.streaming.agent.tailing.FileTailer [TRACE] FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json] is refreshing current tailed file.
2016-07-15 13:28:56.983-0500 axil7 (Agent STARTING) com.amazon.kinesis.streaming.agent.Agent [INFO] Agent: Startup completed in 28 ms.
2016-07-15 13:28:56.983-0500 axil7 (FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]) com.amazon.kinesis.streaming.agent.tailing.FileTailer [TRACE] FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]: There's no file being tailed.
2016-07-15 13:28:57.084-0500 axil7 (FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]) com.amazon.kinesis.streaming.agent.tailing.FileTailer [TRACE] FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]: There's no file being tailed.
2016-07-15 13:28:57.184-0500 axil7 (FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]) com.amazon.kinesis.streaming.agent.tailing.FileTailer [TRACE] FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]: There's no file being tailed.
2016-07-15 13:28:57.285-0500 axil7 (FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]) com.amazon.kinesis.streaming.agent.tailing.FileTailer [TRACE] FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]: There's no file being tailed.
2016-07-15 13:28:57.385-0500 axil7 (FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]) com.amazon.kinesis.streaming.agent.tailing.FileTailer [TRACE] FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]: There's no file being tailed.
2016-07-15 13:28:57.486-0500 axil7 (FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]) com.amazon.kinesis.streaming.agent.tailing.FileTailer [TRACE] FileTailer[fh:Tomahawk:/usr2/cheng/tomahawk-server/logs/tomahawk_2016-07-15_0.json]: There's no file being tailed.
Thanks!
from amazon-kinesis-agent.
Did you grant aws-kinesis-agent-user r+x permission for /usr2/cheng/tomahawk-server/logs? It needs x permission to list the files and determine which file to tail based on the latestModificationTimestamp.
from amazon-kinesis-agent.
Hi,
I double checked the permission of that file and logs directory.
-rwx------ 1 aws-kinesis-agent-user aws-kinesis-agent-user 1025 Jul 15 13:14 tomahawk_2016-07-15_0.json
drwx------ 3 aws-kinesis-agent-user aws-kinesis-agent-user 4096 Jul 15 13:14 logs
Thanks!
from amazon-kinesis-agent.
You can dive through the code from here:
from amazon-kinesis-agent.
Hi, @chaochenq
Thanks for your help. I still have a question:
My linux version is 6.6, I am not sure if it will cause that problem (cannot find local files)?
Thanks!
from amazon-kinesis-agent.
Which distribution is that? RedHat or Ubuntu or something else?
from amazon-kinesis-agent.
I am having the same issue. 0 records sent successfully. No error in the log file. But s3 bucket is empty. Did you have a resolution on this topic. I have spent 3 days researching on this topic and no solution. Where do you want me to add log.level? I dont have any template to compare where exactly and in which file(path) this needs to go?
from amazon-kinesis-agent.
Still having this issues, anybody with the solution on this ?
from amazon-kinesis-agent.
I just did what asafcombo commented above and my problem was solved.
from amazon-kinesis-agent.
Hi All,
For all those who stil haven't got it, please follow the steps below which worked for me
- In the agent.json file, add "filePattern": "/tmp/_access_log*.log". Note that the agent will look for files in the /tmp/ library since it can't look for files in the ec2-user folder
- Run the Python Fake log generator file using the command below
python apache-fake-log-gen.py -n 0 -o LOG -p /tmp/
Please let me know if this does not work for you.
from amazon-kinesis-agent.
Related Issues (20)
- Allow ./setup --build as non-root
- aws-kinesis-agent-latest.amzn1.noarch.rpm is a vulnerable version HOT 3
- Latest S3 RPM agent download is not the latest agent version
- Build fails on AL2
- Kinesis Agent using EC2 metadata
- Use a vuln free version of fasterxml HOT 1
- No Log output when running with start-aws-kinesis-agent HOT 2
- use aws profile credentials for RPi
- Kinesis Agent 1.1.6 fails to send records when IMDSv2 Tokens are required
- Service fails to connect to checkpoint database on startup HOT 1
- How does kinesis agent log getting logrotate? HOT 1
- Unable to Install kinesis agent HOT 2
- openjdk-11-jdk support HOT 2
- maxBufferAgeMillis does work independently
- workaround for debian / ubuntu install agent with openjdk 1.8 by script
- Kinesis Agent is using out of support AWS Java SDK 1.11.700
- Kinesis Agent 2.0.8 fails to send records using IAM role when IMDSv2 is enabled HOT 1
- Build on SLES fails pointing to Redhat
- Is it possible to user a specific value from the data as the partition key
- Kinesis agent failing to start on ubuntu HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazon-kinesis-agent.