3.5.2. Log Search Splunk Provider#
Log Search Splunk Provider paketi ile daha detaylı Splunk sorgularının yapılması hedeflenmektedir.
Not
Log Search Splunk Provider paketi Splunk'a doğrudan bağlantı kurarak işlem yapar. Logger Search Server üzerinden REST ile işlem yapmak istendiği durumda Log Search İstemci API (Client) sayfası ziyaret edilmelidir.
Bağımlılıklar#
Gradle Dependencies
api (
[group: 'tr.com.havelsan.framework.logger', name: 'hvl-logger-search-splunk-provider'],
)
YAML#
hvl:
logger:
search:
splunk:
scheme: ${SPLUNK_SCHEME:https}
host: ${SPLUNK_HOST:localhost}
port: ${SPLUNK_PORT:8089}
username: ${SPLUNK_USERNAME:admin}
password: ${SPLUNK_PASSWORD:hvl12345}
connection-timeout-millis: ${SPLUNK_CONNECTION_TIMEOUT_MILLIS:10000}
search-timeout-millis: ${SPLUNK_SEARCH_TIMEOUT_MILLIS:60000}
ssl:
verify-enabled: ${SPLUNK_SSL_VERIFY_ENABLED:false}
protocol: ${SPLUNK_SSL_PROTOCOL:TLS}
certificate-source-path: ${SPLUNK_SSL_CERTIFICATE_SOURCE_PATH:}
certificate-type: ${SPLUNK_SSL_CERTIFICATE_TYPE:X.509}
certificate-alias: ${SPLUNK_SSL_CERTIFICATE_ALIAS:ca}
trust-store-path: ${SPLUNK_SSL_TRUST_STORE_PATH:}
trust-store-password: ${SPLUNK_SSL_TRUST_STORE_PASSWORD:}
trust-store-type: ${SPLUNK_SSL_TRUST_STORE_TYPE:pkcs12}
key-store-path: ${SPLUNK_SSL_KEY_STORE_PATH:}
key-store-password: ${SPLUNK_SSL_KEY_STORE_PASSWORD:}
key-store-type: ${SPLUNK_SSL_KEY_STORE_TYPE:pkcs12}
Kullanımı#
Log Search Splunk Provider paketinin çalışmasını sağlamak için @HvlEnableLogSearchSplunkProvider anotasyonunun konfigürasyon sınıfına eklenmesi gerekmektedir.
@Configuration
@ComponentScan(basePackages = {HvlLoggerConfigurationConstant.BASE_PACKAGE})
@HvlEnableLogSearchSplunkProvider
public class HvlLoggerConfiguration extends HvlBaseConfiguration {
}
@HvlEnableLogSearchSplunkProvider anotasyonu eklendikten sonra HvlLogSearchSplunkProvider bean'i inject edilerek kullanılmaya başlanabilir.
@Service
public class HvlLoggerSearchServiceImpl implements HvlLoggerSearchService {
private final HvlLogSearchSplunkProvider logSearchSplunkProvider;
public HvlLoggerSearchServiceImpl(HvlLogSearchSplunkProvider logSearchSplunkProvider) {
this.logSearchSplunkProvider = logSearchSplunkProvider;
}
}
Aggregation örneği ve detaylı kullanım ile ilgili tam bir örnek kod için hvl-javalt-samples projesindeki örnek incelenebilir.