|
I have two sourcetypes where the thousandth of a second portion of the timestamp is not padded w/ leading zeros if the time is less than 100 thousandths of a second. Examples: A log event is created at eight AM and eight thousandths of a second. The timestamp for this event would be... 08:00:00:8 Splunk interprets that time as... 08:00:00:800 instead of 08:00:00:008 A log event is created at nine AM and ninety thousandths of a second. The timestamp for this event would be... 09:00:00:90 Splunk interprets that time as... 09:00:00:900 instead of 09:00:00:090 This causes log entries in Splunk to be out of order when viewing a sequence of logs. My question is how I should go about fixing the timestamp for future logs (w/o a huge burden on the indexer). And can I fix the timestamps for events that already exist in my index? I will include some example logs for additional clarification. Note that all items (including date and time) are tab delimited.
Per Lowell's suggestions, I have tried the following permutations for the time format of my sourcetype in the local props.conf file with no improvement...
It's hard to see, but the third and seventh lines have a literal tab between the year and hour, and the fourth and eighth line have a space between the year and hour. |
|
You can't fix the existing entries without deleting and re-indexing your events. (And this is true for any change to your event data; once splunk indexes and event, it's unchangeable) Moving forward, you should be able get splunk to accept the correct timestamp by using an explicit
I'm not 100% sure about the tab thing, you could try putting in a literal tab, or a single space, like so:
Note: Using an explicit Documentation: A couple of things... First, you have listed [dot]%3N however I believe you mean [colon]%3N to match my time format. Is that right? Second, my date stamps are (for example) Aug 03, 2010 So my date portion should be %b %d, %Y correct? Third, the date and time stamps are separated by a tab (the log is tab delimited)...is there a proper way to denote that in the props.conf file?
(05 Aug '10, 22:37)
jeffa
You are correct about the dot vs colon, my mistake. The date pattern does match your example. As far as the tab goes, I think that
(06 Aug '10, 13:10)
Lowell ♦
I set up a lab environment and I've tried all three options (t, literal tab, and space) with no success. I started by importing a log, then changing the props.conf, then importing a second log. I then tried modifying the props.conf prior to any logs being imported and Splunk always appended the zeroes to the end of the 1/1000 second as opposed to padding at the beginning. I stopped splunk and did a "splunk clean eventdata" in between each test. Am I missing something? Any other suggestions?
(06 Aug '10, 15:22)
jeffa
Try using "t" as your separator, and try using
(06 Aug '10, 17:44)
Lowell ♦
Often, you can tweak incoming data using a transformer or a SEDCMD this is pretty useful in general. So you could use either of those features to pad your sub-seconds with leading 0s, but that will not actually solve your issue. This is because Splunk does timestamp recognition before any raw event transformations, so you would end up seeing 3 digits in your events as you want, but the actual timestamps associated with the event (shown on the left) would still be incorrect, just as they are now. ;-(
(06 Aug '10, 17:52)
Lowell ♦
You mention to 'Try using "t" as your separator'...I have already tried t, are you recommending that I use the quotes?
(10 Aug '10, 14:21)
jeffa
You are correct Lowell...correcting the timestamp after Splunk "recognizes" it will not be helpful
(10 Aug '10, 15:28)
jeffa
Sorry, I was putting quotes around
(13 Aug '10, 13:32)
Lowell ♦
showing 5 of 8
show 3 more comments ▼
|
|
This is not an "answer" but more of a list of things I've tried on my system with no workable solutions, so I'm calling on the help of those more knowledgeable gurus, like Gerald. I confirmed that both the following timestamp format strings to do not work, just as Jeffa has reported:
Knowing that the sub-seconds is actually stored in the indexed So I used a Here is the config I tried: props.conf:
transforms.conf:
This config actually prevents the events from being indexed at all. But if you change, the format line to On a further test, I determined that if you modify the example data and replace the " |
Jeffa, I've attempted to reformat your examples so you can see the tabs and all. (If you don't like how it looks, you can revert my changes.)
That looks better...thanks. Might I ask how you added the literal tabs? I couldn't find a reference to it, and when I hit the Tab key, I go to the next input box.
Just add 4 spaces at the start of the line.