Created
May 30, 2018 18:45
-
-
Save mcdan/d4fc015451d01a72f326e297a4054e9e to your computer and use it in GitHub Desktop.
Splunk Cloud Integration Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it should "work with a splunk cloud system" in { | |
/* | |
Required application.conf | |
akka { | |
ssl-config { | |
loose { | |
disableHostnameVerification = true | |
acceptAnyCertificate = true | |
} | |
} | |
} | |
*/ | |
val host = "<snip>" | |
val username = "<snip>" | |
val password = "<snip>" | |
val index = "<snip>" | |
val activation = WhiskActivation( | |
namespace = EntityPath("ns"), | |
name = EntityName("a"), | |
Subject(), | |
activationId = ActivationId.parse("886611f5b73d49dfa611f5b73de9dfcd").get, | |
start = ZonedDateTime.parse("2007-12-03T10:15:30Z").toInstant, | |
end = ZonedDateTime.parse("2027-12-03T10:15:30Z").toInstant, | |
response = ActivationResponse.success(Some(JsObject("res" -> JsNumber(1)))), | |
annotations = Parameters("limits", ActionLimits(TimeLimit(1.second), MemoryLimit(128.MB), LogLimit(1.MB)).toJson), | |
duration = Some(123)) | |
val cloudConfig = SplunkLogStoreConfig( | |
host, | |
8089, | |
username, | |
password, | |
index, | |
"log_message", | |
"activation_id", | |
disableSNI = false) | |
val splunkLogStore = new SplunkLogStore(system, splunkConfig = cloudConfig) | |
val results = await(splunkLogStore.fetchLogs(user, activation, request)) | |
results.logs should have length 50 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment