Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a large amount of existing data stored in files on a NAS (stored in hierarchical date-based directories, not that I think that matters). These directories are still being written to.

I have created a new syslog-ng file() source to process this data. However, when I start up the syslog-ng service, it starts processing the data from the beginning (going back several years). It will take far to long to process all that data, and it's useless anyway.

I want syslog-ng to only process new data that is added to the directory on the NAS. To set the pointer stored in syslog-ng.persist directly to the end of the files, as it were. Is this possible?

share|improve this question
    
What version of syslog-ng are you running? –  mghocke Jun 14 '12 at 17:04
    
4.0.1a (premium) –  Marc Harris Jun 14 '12 at 20:41
    
Ah, their closed source product. AFAIK it is based on their open sourced project and I assume the file format of syslog-ng.persist doesn't change too often. Just to check, could you run the 'strings' command on that file and tell us the magic string at the beginning of the file? It should say something like "SLP3" (pre 3.2 OSE) or "SLP4" (3.2 and above, OSE). –  mghocke Jun 14 '12 at 21:10
    
The first line was "SLP4a" without the quotes –  Marc Harris Jun 15 '12 at 16:06
add comment

1 Answer

There are no official tools out there that allow you to edit the file location pointer within the syslog-ng.persist file. A quick look at the source code of syslog-ng shows, though, that it shouldn't be too hard to write your own tool to get this done. It takes a bit more effort if this is syslog-ng 3.1 or lower because most code has to be copied and pasted from the source distribution. With 3.2 and above the important code comes in a shared library and corresponding header file that can be used by the tool.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.