<?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 Re: Report required from Syslog data from Cisco ACS in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Report-required-from-Syslog-data-from-Cisco-ACS/m-p/75414#M15381</link>
    <description>&lt;P&gt;What ways have you tried without success? I can think of two ways you could achieve this fairly easily: either using &lt;CODE&gt;transaction&lt;/CODE&gt; or using &lt;CODE&gt;stats&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;1) &lt;CODE&gt;transaction&lt;/CODE&gt;: the only thing that might be a bit tricky is to get the start time and end time right. &lt;CODE&gt;transaction&lt;/CODE&gt; always produces the field &lt;CODE&gt;duration&lt;/CODE&gt; that is exactly what it says, the duration of the transaction (= the difference between the timestamps of the first and last event in the transaction), so adding that value to the transaction's &lt;CODE&gt;_time&lt;/CODE&gt; gives you the last time. I also did some time output formatting using &lt;CODE&gt;strftime&lt;/CODE&gt; in order to make it human readable. The &lt;CODE&gt;duration&lt;/CODE&gt; field could also be used instead of the &lt;CODE&gt;Acct-Session-Time&lt;/CODE&gt; field, in case you don't trust the duration calculated by the ACS &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | transaction Acct-Session-Id | eval Starttime=strftime(_time,"%+") | eval Endtime=strftime(_time+duration,"%+") | table NetworkDeviceName User-Name Starttime Endtime Acct-Session-Id Acct-Session-Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The drawback with using &lt;CODE&gt;transaction&lt;/CODE&gt; is it can be pretty resource intensive.&lt;/P&gt;

&lt;P&gt;2) You can use &lt;CODE&gt;stats&lt;/CODE&gt; and split on &lt;CODE&gt;Acct-Session-Id&lt;/CODE&gt; because it is a unique identifier for each session. &lt;CODE&gt;stats&lt;/CODE&gt; always requires a statistical operation to be run on each field it takes as an input, so with field carrying absolute values, just use &lt;CODE&gt;first()&lt;/CODE&gt; to get this. NOTE that I use &lt;CODE&gt;last(_time)&lt;/CODE&gt; and &lt;CODE&gt;first(_time)&lt;/CODE&gt; for getting the Starttime and Lasttime, respectively - this might seem confusing, but has to do with how results arrive in reverse chronological order from the search pipeline, so the latest events comes first and therefore &lt;CODE&gt;first(_time)&lt;/CODE&gt; grabs the latest event it comes across. Also the &lt;CODE&gt;eval/strftime&lt;/CODE&gt; statements are again done in order to get human readable timestamps.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats first(NetworkDeviceName) as NetworkDeviceName,first(Username) as Username,last(_time) as Starttime,first(_time) as Endtime,first(Acct-Session-Time) as Acct-Session-Time by Acct-Session-Id | eval Starttime=strftime(Starttime,"%+") | eval Endtime=strftime(Endtime,"%+") | table NetworkDeviceName Username Starttime Endtime Acct-Session-Id Acct-Session-Time 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 21 Feb 2012 07:37:56 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2012-02-21T07:37:56Z</dc:date>
    <item>
      <title>Report required from Syslog data from Cisco ACS</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Report-required-from-Syslog-data-from-Cisco-ACS/m-p/75413#M15380</link>
      <description>&lt;P&gt;I have a Cisco ACS serving radius requests for VPN users. The syslog is configured for splunk and is able to receive data and index all fields. Following are the sample log texts shown for a particular user (XXXX_user93) (only interesting fields)&lt;BR /&gt;
a) &lt;STRONG&gt;RADIUS Start record&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Feb 21 10:32:34 2012-02-21 10:32:34.134 +05:30 &lt;STRONG&gt;NOTICE Radius-Accounting&lt;/STRONG&gt;: RADIUS Accounting start request, &lt;STRONG&gt;NetworkDeviceName&lt;/STRONG&gt;=XXXX_Roam_Connect, &lt;STRONG&gt;User-Name&lt;/STRONG&gt;=XXXX_user93, Framed-IP-Address=10.32.38.93, Calling-Station-ID=113.128.64.130, NAS-Identifier= YYYY-FG-MUMENT, &lt;STRONG&gt;Acct-Status-Type&lt;/STRONG&gt;=Start, &lt;STRONG&gt;Acct-Session-Id&lt;/STRONG&gt;=00a2fc9c, AcsSessionID= INMAA-TDL-ACS-I/112925452/1282834, &lt;/P&gt;

&lt;P&gt;b)Corresponding &lt;STRONG&gt;RADIUS Stop record&lt;/STRONG&gt;&lt;BR /&gt;
Feb 21 10:32:41 2012-02-21 10:32:41.127 +05:30 &lt;STRONG&gt;NOTICE Radius-Accounting&lt;/STRONG&gt;: RADIUS Accounting stop request, NetworkDeviceName=XXXX_Roam_Connect, User-Name=XXXX_user93, Framed-IP-Address=10.32.38.93, Calling-Station-ID=113.128.64.130, NAS-Identifier=YYYY-FG-MUMENT, &lt;STRONG&gt;Acct-Status-Type&lt;/STRONG&gt;=Stop, &lt;STRONG&gt;Acct-Session-Id&lt;/STRONG&gt;=00a2fc9c, &lt;STRONG&gt;Acct-Session-Time&lt;/STRONG&gt;=468, Acct-Terminate-Cause=NAS Error, AcsSessionID=INMAA-TDL-ACS-I/112925452/1282838&lt;/P&gt;

&lt;P&gt;The start and stop requests are correlated by the field &lt;STRONG&gt;Acct-Session-Id&lt;/STRONG&gt; for which the value would be the same for a particular users start and stop record.&lt;/P&gt;

&lt;P&gt;What we are looking is a daily, weekly, monthly report in a tabular format, something similar to this&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;NetworkDeviceName | Username | Starttime | Endtime | Acct-Session-Id | Acct-Session-Time&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I have tried with no success&lt;/P&gt;

&lt;P&gt;We are currently evaluating Splunk and would like help in achieving the above. Have searched for apps in Splunk base and couldnt find any.&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:25:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Report-required-from-Syslog-data-from-Cisco-ACS/m-p/75413#M15380</guid>
      <dc:creator>raki</dc:creator>
      <dc:date>2020-09-28T11:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Report required from Syslog data from Cisco ACS</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Report-required-from-Syslog-data-from-Cisco-ACS/m-p/75414#M15381</link>
      <description>&lt;P&gt;What ways have you tried without success? I can think of two ways you could achieve this fairly easily: either using &lt;CODE&gt;transaction&lt;/CODE&gt; or using &lt;CODE&gt;stats&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;1) &lt;CODE&gt;transaction&lt;/CODE&gt;: the only thing that might be a bit tricky is to get the start time and end time right. &lt;CODE&gt;transaction&lt;/CODE&gt; always produces the field &lt;CODE&gt;duration&lt;/CODE&gt; that is exactly what it says, the duration of the transaction (= the difference between the timestamps of the first and last event in the transaction), so adding that value to the transaction's &lt;CODE&gt;_time&lt;/CODE&gt; gives you the last time. I also did some time output formatting using &lt;CODE&gt;strftime&lt;/CODE&gt; in order to make it human readable. The &lt;CODE&gt;duration&lt;/CODE&gt; field could also be used instead of the &lt;CODE&gt;Acct-Session-Time&lt;/CODE&gt; field, in case you don't trust the duration calculated by the ACS &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | transaction Acct-Session-Id | eval Starttime=strftime(_time,"%+") | eval Endtime=strftime(_time+duration,"%+") | table NetworkDeviceName User-Name Starttime Endtime Acct-Session-Id Acct-Session-Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The drawback with using &lt;CODE&gt;transaction&lt;/CODE&gt; is it can be pretty resource intensive.&lt;/P&gt;

&lt;P&gt;2) You can use &lt;CODE&gt;stats&lt;/CODE&gt; and split on &lt;CODE&gt;Acct-Session-Id&lt;/CODE&gt; because it is a unique identifier for each session. &lt;CODE&gt;stats&lt;/CODE&gt; always requires a statistical operation to be run on each field it takes as an input, so with field carrying absolute values, just use &lt;CODE&gt;first()&lt;/CODE&gt; to get this. NOTE that I use &lt;CODE&gt;last(_time)&lt;/CODE&gt; and &lt;CODE&gt;first(_time)&lt;/CODE&gt; for getting the Starttime and Lasttime, respectively - this might seem confusing, but has to do with how results arrive in reverse chronological order from the search pipeline, so the latest events comes first and therefore &lt;CODE&gt;first(_time)&lt;/CODE&gt; grabs the latest event it comes across. Also the &lt;CODE&gt;eval/strftime&lt;/CODE&gt; statements are again done in order to get human readable timestamps.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats first(NetworkDeviceName) as NetworkDeviceName,first(Username) as Username,last(_time) as Starttime,first(_time) as Endtime,first(Acct-Session-Time) as Acct-Session-Time by Acct-Session-Id | eval Starttime=strftime(Starttime,"%+") | eval Endtime=strftime(Endtime,"%+") | table NetworkDeviceName Username Starttime Endtime Acct-Session-Id Acct-Session-Time 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Feb 2012 07:37:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Report-required-from-Syslog-data-from-Cisco-ACS/m-p/75414#M15381</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-02-21T07:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Report required from Syslog data from Cisco ACS</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Report-required-from-Syslog-data-from-Cisco-ACS/m-p/75415#M15382</link>
      <description>&lt;P&gt;Thanks Ayn, have been trying the transaction method without any success. Anyway applied your searches and here are the results&lt;/P&gt;

&lt;P&gt;a) The transaction method works perfect. ONe question I have though is how can I group the table by username such as a single username has multiple records. I would want to publish a report by username and all associated records&lt;/P&gt;

&lt;P&gt;b) The stats method works but is there a way I can get the duration as in transaction than Acc_Session_Time as reported by ACS&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:25:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Report-required-from-Syslog-data-from-Cisco-ACS/m-p/75415#M15382</guid>
      <dc:creator>raki</dc:creator>
      <dc:date>2020-09-28T11:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Report required from Syslog data from Cisco ACS</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Report-required-from-Syslog-data-from-Cisco-ACS/m-p/75416#M15383</link>
      <description>&lt;P&gt;a) A mix of &lt;CODE&gt;transaction&lt;/CODE&gt; and stats might be a good idea - use the basic command in 1) and then do something like in 2), adding a "count" to the stats.&lt;/P&gt;

&lt;P&gt;b) You can &lt;CODE&gt;eval&lt;/CODE&gt; the difference between the last and first timestamp for each stats entry, which will give you the duration.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2012 14:52:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Report-required-from-Syslog-data-from-Cisco-ACS/m-p/75416#M15383</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-02-21T14:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Report required from Syslog data from Cisco ACS</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Report-required-from-Syslog-data-from-Cisco-ACS/m-p/75417#M15384</link>
      <description>&lt;P&gt;For doing this in a production situation - especially with a monthly report - I would look into summary indexing.  Also, depending on how long someone is connected, it may be better to maintain connection state in a lookup table, ala &lt;A href="http://blogs.splunk.com/2011/01/11/maintaining-state-of-the-union/"&gt;http://blogs.splunk.com/2011/01/11/maintaining-state-of-the-union/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2012 14:59:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Report-required-from-Syslog-data-from-Cisco-ACS/m-p/75417#M15384</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2012-02-21T14:59:44Z</dc:date>
    </item>
  </channel>
</rss>

