@@ -207,7 +207,7 @@ def test_cisco_ise_cise_alarm_single(
207
207
sendsingle (message , setup_sc4s [0 ], setup_sc4s [1 ][514 ])
208
208
209
209
st = env .from_string (
210
- 'search index=netauth host="{{ host }}" sourcetype="cisco:ise:syslog" "Server=10.0.0.5"'
210
+ 'search index=netauth host="{{ host }}" sourcetype="cisco:ise:syslog" "CISE_Alarm WARN: RADIUS Authentication Request dropped : Server=10.0.0.5; "'
211
211
)
212
212
search = st .render (epoch = epoch , host = host )
213
213
@@ -218,3 +218,102 @@ def test_cisco_ise_cise_alarm_single(
218
218
record_property ("message" , message )
219
219
220
220
assert result_count == 1
221
+
222
+ @pytest .mark .addons ("cisco" )
223
+ def test_cisco_ise_double_timestamp_and_hostname (
224
+ record_property , setup_splunk , setup_sc4s
225
+ ):
226
+ host = f"{ shortuuid .ShortUUID ().random (length = 5 ).lower ()} -{ shortuuid .ShortUUID ().random (length = 5 ).lower ()} "
227
+
228
+ dt = datetime .datetime .now ()
229
+ _ , bsd , time , date , tzoffset , _ , epoch = time_operations (dt )
230
+
231
+ # Tune time functions for Cisco ISE
232
+ time = time [:- 3 ]
233
+ tzoffset = tzoffset [0 :3 ] + ":" + tzoffset [3 :]
234
+ epoch = epoch [:- 3 ]
235
+
236
+ mt = env .from_string (
237
+ "{{ mark }}{{ bsd }} wrong_host {{ bsd }} {{ host }} CISE_System_Statistics 0000001313 1 4 2020-01-01 10:00:00.000000 +00:00 0000015291 70501 NOTICE System-Stats: ISE Counters, ConfigVersionId=1, OperationCounters=Counter=1_LocalEndPointReads:1]\n "
238
+ )
239
+ message = mt .render (
240
+ mark = "<165>" , bsd = bsd , host = host , date = date , time = time , tzoffset = tzoffset
241
+ )
242
+ sendsingle (message , setup_sc4s [0 ], setup_sc4s [1 ][514 ])
243
+
244
+ st = env .from_string (
245
+ 'search index=netauth host="{{ host }}" sourcetype="cisco:ise:syslog" "CISE_System_Statistics: 0000001313 1 4 2020-01-01 10:00:00.000000"'
246
+ )
247
+ search = st .render (epoch = epoch , host = host )
248
+
249
+ result_count , _ = splunk_single (setup_splunk , search )
250
+
251
+ record_property ("host" , host )
252
+ record_property ("resultCount" , result_count )
253
+ record_property ("message" , message )
254
+
255
+ assert result_count == 1
256
+
257
+ @pytest .mark .addons ("cisco" )
258
+ def test_cisco_ise_double_timestamp_and_hostname_sequence_eq_0 (
259
+ record_property , setup_splunk , setup_sc4s
260
+ ):
261
+ host = f"{ shortuuid .ShortUUID ().random (length = 5 ).lower ()} -{ shortuuid .ShortUUID ().random (length = 5 ).lower ()} "
262
+
263
+ dt = datetime .datetime .now ()
264
+ _ , bsd , time , date , tzoffset , _ , epoch = time_operations (dt )
265
+
266
+ # Tune time functions for Cisco ISE
267
+ time = time [:- 3 ]
268
+ tzoffset = tzoffset [0 :3 ] + ":" + tzoffset [3 :]
269
+ epoch = epoch [:- 3 ]
270
+
271
+ mt = env .from_string (
272
+ "{{ mark }}{{ bsd }} wrong_host {{ bsd }} {{ host }} CISE_System_Statistics 0000001313 4 0 {{ date }} {{ time }} {{ tzoffset }} 0000015291 70501 NOTICE System-Stats: part one,\n "
273
+ )
274
+
275
+ message = mt .render (
276
+ mark = "<165>" , bsd = bsd , host = host , date = date , time = time , tzoffset = tzoffset
277
+ )
278
+ sendsingle (message , setup_sc4s [0 ], setup_sc4s [1 ][514 ])
279
+
280
+ # Generate new datetime for subsequent messages; not used in log path parser so actually could be anything
281
+ dt = datetime .datetime .now () + datetime .timedelta (seconds = 1 )
282
+ bsd = dt .strftime ("%b %d %H:%M:%S" )
283
+
284
+ mt = env .from_string (
285
+ "{{ mark }}{{ bsd }} wrong_host {{ bsd }} {{ host }} CISE_System_Statistics 0000001313 4 1 part two,\n "
286
+ )
287
+ message = mt .render (
288
+ mark = "<111>" , bsd = bsd , host = host , date = date , time = time , tzoffset = tzoffset
289
+ )
290
+ sendsingle (message , setup_sc4s [0 ], setup_sc4s [1 ][514 ])
291
+
292
+ mt = env .from_string (
293
+ "{{ mark }}{{ bsd }} wrong_host {{ bsd }} {{ host }} CISE_System_Statistics 0000001313 4 2 part three,\n "
294
+ )
295
+ message = mt .render (
296
+ mark = "<111>" , bsd = bsd , host = host , date = date , time = time , tzoffset = tzoffset
297
+ )
298
+ sendsingle (message , setup_sc4s [0 ], setup_sc4s [1 ][514 ])
299
+
300
+ mt = env .from_string (
301
+ "{{ mark }}{{ bsd }} wrong_host {{ bsd }} {{ host }} CISE_System_Statistics 0000001313 4 3 part four,\n "
302
+ )
303
+ message = mt .render (
304
+ mark = "<111>" , bsd = bsd , host = host , date = date , time = time , tzoffset = tzoffset
305
+ )
306
+ sendsingle (message , setup_sc4s [0 ], setup_sc4s [1 ][514 ])
307
+
308
+ st = env .from_string (
309
+ 'search _time={{ epoch }} index=netauth host="{{ host }}" sourcetype="cisco:ise:syslog" one two three four'
310
+ )
311
+ search = st .render (epoch = epoch , host = host )
312
+
313
+ result_count , _ = splunk_single (setup_splunk , search )
314
+
315
+ record_property ("host" , host )
316
+ record_property ("resultCount" , result_count )
317
+ record_property ("message" , message )
318
+
319
+ assert result_count == 1
0 commit comments