tysonnorris commented on a change in pull request #2957: splunk logstore

 File path: 
 @@ -0,0 +1,156 @@
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package whisk.core.containerpool.logging
+import akka.actor.ActorSystem
+import akka.http.scaladsl.Http
+import java.time.ZoneId
+import java.time.format.DateTimeFormatter
+import akka.http.scaladsl.client.RequestBuilding.Post
+import akka.http.scaladsl.model.FormData
+import akka.http.scaladsl.model.HttpRequest
+import akka.http.scaladsl.model.HttpResponse
+import akka.http.scaladsl.model.headers.Authorization
+import akka.http.scaladsl.model.headers.BasicHttpCredentials
+import akka.http.scaladsl.unmarshalling.Unmarshal
+import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
+import akka.stream.ActorMaterializer
+import akka.stream.OverflowStrategy
+import akka.stream.QueueOfferResult
+import akka.stream.scaladsl.Flow
+import akka.stream.scaladsl.Keep
+import akka.stream.scaladsl.Sink
+import akka.stream.scaladsl.Source
+import com.typesafe.sslconfig.akka.AkkaSSLConfig
+import scala.concurrent.Future
+import scala.concurrent.Promise
+import scala.util.Failure
+import scala.util.Success
+import scala.util.Try
+import spray.json.DefaultJsonProtocol._
+import spray.json.JsArray
+import spray.json._
+import whisk.core.entity.ActivationLogs
+import whisk.core.entity.WhiskActivation
+import pureconfig._
+case class SplunkLogStoreConfig(host: String,
+                                port: Int,
+                                username: String,
+                                password: String,
+                                index: String,
+                                logMessageField: String,
+                                activationIdField: String,
+                                disableSNI: Boolean)
+ * A Splunk based impl of LogDriverLogStore. Logs are routed to splunk via 
docker log driver, and retrieved via Splunk REST API
+ *
+ * @param actorSystem
+ * @param httpFlow Optional Flow to use for HttpRequest handling (to enable 
stream based tests)
+ */
+class SplunkLogStore(
+  actorSystem: ActorSystem,
+  httpFlow: Option[Flow[(HttpRequest, Promise[HttpResponse]), 
(Try[HttpResponse], Promise[HttpResponse]), Any]] = None,
+  splunkConfig: SplunkLogStoreConfig = 
+    extends LogDriverLogStore(actorSystem) {
+  implicit val as = actorSystem
+  implicit val ec = as.dispatcher
+  implicit val materializer = ActorMaterializer()
+  private val splunkApi = "/services/search/jobs" //see 
 Review comment:
   Can, but have to use `Post(Uri(path = splunkApi))` in that case?

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

Reply via email to