<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Radius Accounting Data Timestamping events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Radius-Accounting-Data-Timestamping-events/m-p/241567#M71829</link>
    <description>&lt;P&gt;Might be related to &lt;A href="https://answers.splunk.com/answers/168995/how-to-write-regex-to-identify-and-use-time-field.html"&gt;https://answers.splunk.com/answers/168995/how-to-write-regex-to-identify-and-use-time-field.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I have some RADIUS accounting logs that i send into splunk and this is my current props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[radius_acct_detail]
SHOULD_LINEMERGE = true
BREAK_ONLY_BEFORE = ^\w{3} \w{3} \d\d \d\d:\d\d:\d\d \d\d\d\d$
TIME_PREFIX = Event-Timestamp = "
TIME_FORMAT = %b %d %Y %H:%M:%S %z
MAX_TIMESTAMP_LOOKAHEAD = -1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now most but not all radius accounting events have the Event-Timestamp field in them, for example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Thu Jun 30 04:24:27 2016
    Acct-Status-Type = Accounting-Off
    Acct-Authentic = RADIUS
    User-Name = "XX-XX-XX-XX-XX-XX"
    NAS-IP-Address = 172.20.dd.ddd
    NAS-Identifier = "XX-XX-XX-XX-XX-XX"
    Called-Station-Id = "XX-XX-XX-XX-XX-XX:ZOLspot"
    Ruckus-SSID = "ZOLspot"
    Ruckus-Attr-14 = 0xXXXXXXXXXXXX
    Ruckus-WlanID = 362
    Ruckus-Attr-9 = 0xXXXXXXXX
    Ruckus-SCG-CBlade-IP = XXXXXXXXXX
    Ruckus-SCG-DBlade-IP = XXXXXXXXX
    Proxy-State = 0x31
    Acct-Unique-Session-Id = "6716f5d57c72963e"
    Realm = "NULL"
    Timestamp = 1467253467
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;as a result i get various regular parsing timestamp errors in the splunk log that i'd like to clean up. ideally what i'd want to happen in this case is for it to fall back to the Timestamp field (epoch time) which is present in every event or the first line of the event which is the time the packet is logged by the radius server (these are the same in the case of these packets  but the Event-Timestamp field can and does in cases differ from this timestamp&lt;/P&gt;

&lt;P&gt;reading the other answer it seems i could do some greedy regex to capture the first timestamp field if the Event-Timestamp field is not present but the format of the field is different:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    Event-Timestamp = "Jun 30 2016 08:29:11 CAT"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;specifically day is omitted and TZ is added and Year is in a different spot. anyone have any thoughts on some regex foo that might work or should we somehow look down the custom datetime.xml route?&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jun 2016 10:33:19 GMT</pubDate>
    <dc:creator>anthonysomerset</dc:creator>
    <dc:date>2016-06-30T10:33:19Z</dc:date>
    <item>
      <title>Radius Accounting Data Timestamping events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Radius-Accounting-Data-Timestamping-events/m-p/241567#M71829</link>
      <description>&lt;P&gt;Might be related to &lt;A href="https://answers.splunk.com/answers/168995/how-to-write-regex-to-identify-and-use-time-field.html"&gt;https://answers.splunk.com/answers/168995/how-to-write-regex-to-identify-and-use-time-field.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I have some RADIUS accounting logs that i send into splunk and this is my current props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[radius_acct_detail]
SHOULD_LINEMERGE = true
BREAK_ONLY_BEFORE = ^\w{3} \w{3} \d\d \d\d:\d\d:\d\d \d\d\d\d$
TIME_PREFIX = Event-Timestamp = "
TIME_FORMAT = %b %d %Y %H:%M:%S %z
MAX_TIMESTAMP_LOOKAHEAD = -1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now most but not all radius accounting events have the Event-Timestamp field in them, for example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Thu Jun 30 04:24:27 2016
    Acct-Status-Type = Accounting-Off
    Acct-Authentic = RADIUS
    User-Name = "XX-XX-XX-XX-XX-XX"
    NAS-IP-Address = 172.20.dd.ddd
    NAS-Identifier = "XX-XX-XX-XX-XX-XX"
    Called-Station-Id = "XX-XX-XX-XX-XX-XX:ZOLspot"
    Ruckus-SSID = "ZOLspot"
    Ruckus-Attr-14 = 0xXXXXXXXXXXXX
    Ruckus-WlanID = 362
    Ruckus-Attr-9 = 0xXXXXXXXX
    Ruckus-SCG-CBlade-IP = XXXXXXXXXX
    Ruckus-SCG-DBlade-IP = XXXXXXXXX
    Proxy-State = 0x31
    Acct-Unique-Session-Id = "6716f5d57c72963e"
    Realm = "NULL"
    Timestamp = 1467253467
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;as a result i get various regular parsing timestamp errors in the splunk log that i'd like to clean up. ideally what i'd want to happen in this case is for it to fall back to the Timestamp field (epoch time) which is present in every event or the first line of the event which is the time the packet is logged by the radius server (these are the same in the case of these packets  but the Event-Timestamp field can and does in cases differ from this timestamp&lt;/P&gt;

&lt;P&gt;reading the other answer it seems i could do some greedy regex to capture the first timestamp field if the Event-Timestamp field is not present but the format of the field is different:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    Event-Timestamp = "Jun 30 2016 08:29:11 CAT"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;specifically day is omitted and TZ is added and Year is in a different spot. anyone have any thoughts on some regex foo that might work or should we somehow look down the custom datetime.xml route?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 10:33:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Radius-Accounting-Data-Timestamping-events/m-p/241567#M71829</guid>
      <dc:creator>anthonysomerset</dc:creator>
      <dc:date>2016-06-30T10:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Radius Accounting Data Timestamping events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Radius-Accounting-Data-Timestamping-events/m-p/241568#M71830</link>
      <description>&lt;P&gt;So i ended up cheating on this with something thats probably not the best approach but works for me&lt;/P&gt;

&lt;P&gt;Rather than try to solve the problem in splunk i looked at solving this at the source, and turns out with a little bit of freeradius logic i can solve this.&lt;/P&gt;

&lt;P&gt;I defined the following function that i call within the accounting section of freeradius&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;append_timestamp_to_acct {
                if (Acct-Status-Type == "Accounting-On" || Acct-Status-Type == "Accounting-Off") {
                    if (!Event-Timestamp) {
                        update request {
                                Event-Timestamp = "%l"
                        }
                    }
                }
        }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;what this function does is set the Event-Timestamp attribute if its not present and this is an Accounting-On or Accounting-Off request&lt;/P&gt;

&lt;P&gt;it sets it to the current timestamp (which happens to be the correct format for the Event-Timestamp attribute to start with) which then gets matched in my event in splunk - %l is a freeradius runtime variable for timestamp - &lt;A href="http://wiki.freeradius.org/config/run_time_variables"&gt;http://wiki.freeradius.org/config/run_time_variables&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I probbaly don't need the acct-status-type as the check if Event-Timestamp is not present (or empty string) would probably suffice on its own, just being explicitly careful as these are the only packets i've found where the attribute is not set so far&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 13:53:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Radius-Accounting-Data-Timestamping-events/m-p/241568#M71830</guid>
      <dc:creator>anthonysomerset</dc:creator>
      <dc:date>2016-06-30T13:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Radius Accounting Data Timestamping events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Radius-Accounting-Data-Timestamping-events/m-p/241569#M71831</link>
      <description>&lt;P&gt;When dealing with multiple time &lt;EM&gt;formats&lt;/EM&gt; (not positions), you really have no choice but to use &lt;CODE&gt;datetime.xml&lt;/CODE&gt;:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.function1.com/2013/01/oh-no-splunking-log-files-with-multiple-formats-no-problem"&gt;http://www.function1.com/2013/01/oh-no-splunking-log-files-with-multiple-formats-no-problem&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 14:25:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Radius-Accounting-Data-Timestamping-events/m-p/241569#M71831</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-30T14:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Radius Accounting Data Timestamping events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Radius-Accounting-Data-Timestamping-events/m-p/241570#M71832</link>
      <description>&lt;P&gt;The question is, does custom datetime.xml accept first rule match? the default timestamp exists for every entry but if the Event-Timestamp exists i want to prefer it over the default timestamp&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 14:28:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Radius-Accounting-Data-Timestamping-events/m-p/241570#M71832</guid>
      <dc:creator>anthonysomerset</dc:creator>
      <dc:date>2016-06-30T14:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Radius Accounting Data Timestamping events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Radius-Accounting-Data-Timestamping-events/m-p/241571#M71833</link>
      <description>&lt;P&gt;As far as preferential field selection for time, see this:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/168995/how-to-write-regex-to-identify-and-use-time-field.html"&gt;https://answers.splunk.com/answers/168995/how-to-write-regex-to-identify-and-use-time-field.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2016 14:48:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Radius-Accounting-Data-Timestamping-events/m-p/241571#M71833</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-30T14:48:26Z</dc:date>
    </item>
  </channel>
</rss>

