Skip to content

Commit 91a44ce

Browse files
authored
Merge pull request #20 from marklogic-community/develop
1.1.1 release
2 parents 01b6be0 + bd11553 commit 91a44ce

22 files changed

+220
-79
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2019 MarkLogic Corporation.
1+
Copyright © 2020 MarkLogic Corporation.
22

33
Licensed 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
44

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MarkLogic® Monitoring App for Splunk
22

3-
Copyright © 2019 MarkLogic Corporation.
3+
Copyright © 2020 MarkLogic Corporation.
44

55
This project and its code and functionality is not representative of MarkLogic Server and is not supported by MarkLogic.
66

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# MarkLogic Monitoring for Splunk
22

3-
MarkLogic Monitoring for Splunk provides configurations and pre-built dashboards that deliver real-time visibility into Error, Access, and Audit log events
4-
to monitor and analyze MarkLogic logs with Splunk.
3+
MarkLogic Monitoring for Splunk provides configurations and pre-built dashboards that deliver real-time visibility into Error, Access, Request,
4+
and Audit log events to monitor and analyze MarkLogic logs with Splunk.
55

66
![Monitoring dashboard](src/main/resources/appserver/static/screenshot.png "Monitoring dashboard")
77

@@ -46,10 +46,11 @@ Below are example stanzas that can be applied to your *inputs.conf* in order to
4646
The MarkLogic Monitoring dashboard queries make use of *macros* in order to construct base queries that target
4747
MarkLogic log events from the MarkLogic sourcetypes for Error, Access, and Audit logs
4848

49-
- *marklogic_index* - search criteria limited to `(index=main OR index=marklogic)`
49+
- *marklogic_index* - search criteria limited to `(index=default OR index=main OR index=marklogic)`
5050
- *marklogic_access* - restricts searches to the MarkLogic *_AccessLog.txt events
5151
- *marklogic_audit* - restricts searches to the MarkLogic AuditLog.txt events
5252
- *marklogic_error* - restricts searches to the *ErrorLog.txt events
53+
- *marklogic_request* - restricts searches to the *_RequestrLog.txt events
5354

5455
You can change these by modifying the *marklogic*, *marklogic_index*, *marklogic_error*, *marklogic_access*,
5556
and *marklogic_audit* macros under *Settings > Advanced search > Search macros*.

build.gradle

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
import org.apache.tools.ant.filters.ReplaceTokens
22
import com.marklogic.client.DatabaseClient
3-
import sun.misc.BASE64Encoder
43

54
plugins {
65
id 'base'
76
id 'net.saliman.properties' version '1.5.1'
8-
id 'com.marklogic.ml-gradle' version '3.16.2'
7+
id 'com.marklogic.ml-gradle' version '4.5.3'
98
}
109

1110
class GenerateLookups extends com.marklogic.gradle.task.MarkLogicTask {
11+
@Input
1212
String modulesDir = 'src/main/ml-modules/'
13+
@Input
1314
String featureQuery = new File("${modulesDir}get-marklogic-features.xqy").getText('UTF-8')
15+
@Input
1416
String errorQuery = new File("${modulesDir}get-marklogic-error-codes.xqy").getText('UTF-8')
15-
17+
@Input
1618
String lookupsDir = 'src/main/resources/lookups/'
19+
@Input
1720
String featureFile = 'marklogic_feature.csv'
21+
@Input
1822
String errorFile = 'marklogic_error.csv'
1923

2024
@TaskAction
@@ -104,9 +108,8 @@ def addAuthorizationToken(connection, token){
104108

105109
def appInpsectLogin() {
106110
def connection = buildAppInspectConnection( 'https://api.splunk.com/2.0/rest/login/splunk', 'GET')
107-
BASE64Encoder enc = new sun.misc.BASE64Encoder();
108111
String userpassword = project.appInspectUsername + ':' + project.appInspectPassword;
109-
String encodedAuthorization = enc.encode( userpassword.getBytes() );
112+
String encodedAuthorization = new String(java.util.Base64.getMimeEncoder().encode( userpassword.getBytes() ), java.nio.charset.StandardCharsets.UTF_8);
110113
connection.setRequestProperty('Authorization', 'Basic ' + encodedAuthorization);
111114
new groovy.json.JsonSlurper().parse(connection.getInputStream())
112115
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name=marklogic-monitoring-for-splunk
22
group=com.marklogic
33
# Splunk requires major.minor.release
4-
version=1.1.0
4+
version=1.1.1
55
appName=marklogic
66

77
splunk_home=/Applications/Splunk

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

src/main/ml-modules/get-marklogic-error-codes.xqy

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@ string-join(
1818
(
1919
"error_code,feature,error_description,error_cause,error_response,error_url",
2020

21-
for $feature in tokenize($FEATURES, ",")
22-
let $error-doc := xdmp:http-get("http://docs.marklogic.com/guide/messages/"||$feature||"-en?print=yes")
21+
for $feature in distinct-values((tokenize($FEATURES, ","), "HEALTH", "JSEARCH"))
22+
let $error-doc := xdmp:http-get("https://docs.marklogic.com/guide/messages/"||$feature||"-en?print=yes",
23+
<options xmlns="xdmp:http">
24+
<verify-cert>false</verify-cert>
25+
</options>
26+
)
2327
let $content := xdmp:unquote($error-doc[2])/html:html/html:body/*/*/html:div[@class="message"]
28+
order by $feature
2429
return (
2530
for $message in $content
2631
let $code := $message/html:h3/html:a/string()

src/main/ml-modules/get-marklogic-features.xqy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ declare function local:cell($val) {
1414
string-join(
1515
(
1616
"feature,feature_description",
17-
let $feature-doc := xdmp:http-get("http://docs.marklogic.com/guide/messages/intro")
17+
let $feature-doc := xdmp:http-get("https://docs.marklogic.com/guide/messages/intro",
18+
<options xmlns="xdmp:http">
19+
<verify-cert>false</verify-cert>
20+
</options>
21+
)
1822
let $rows := xdmp:unquote($feature-doc[2])/html:html/html:body/*//html:div[html:p/html:a/@id="id_pgfId-1059358"]/html:table[@class="api_generic_table"]/html:tr[html:td]
1923
return (
2024
for $row in $rows

src/main/resources/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MarkLogic® Monitoring App for Splunk
22

3-
Copyright © 2019 MarkLogic Corporation.
3+
Copyright © 2020 MarkLogic Corporation.
44

55
This project and its code and functionality is not representative of MarkLogic Server and is not supported by MarkLogic.
66

src/main/resources/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# MarkLogic Monitoring for Splunk
22

3-
MarkLogic Monitoring for Splunk provides configurations and pre-built dashboards that deliver real-time visibility into Error, Access, and Audit log events
4-
to monitor and analyze MarkLogic logs with Splunk.
3+
MarkLogic Monitoring for Splunk provides configurations and pre-built dashboards that deliver real-time visibility into
4+
Error, Access, Request, and Audit log events to monitor and analyze MarkLogic logs with Splunk.
55

66
The app includes:
77
- Monitoring dashboard providing an overview of cluster activity and highlighting significant error events
88
- Log file dashboards with filters for Error, Access, and Audit log fields
9-
- Pre-configured soucetypes and fields for MarkLogic Error, Access, and Audit log messages
9+
- Pre-configured soucetypes and fields for MarkLogic Error, Access, Request, and Audit log messages
1010
- Lookups configured with MarkLogic [features, error codes](https://docs.marklogic.com/guide/messages/intro), and [log levels](https://docs.marklogic.com/guide/admin/logfiles#id_37841)
1111

1212
## Configuration
@@ -41,13 +41,14 @@ Below are example stanzas that can be applied to your *inputs.conf* in order to
4141
The MarkLogic Monitoring dashboard queries make use of *macros* in order to construct base queries that target
4242
MarkLogic log events from the MarkLogic sourcetypes for Error, Access, and Audit logs
4343

44-
- *marklogic_index* - search criteria limited to `(index=main OR index=marklogic)`
44+
- *marklogic_index* - search criteria limited to `(index=default OR index=main OR index=marklogic)`
4545
- *marklogic_access* - restricts searches to the MarkLogic *_AccessLog.txt events
4646
- *marklogic_audit* - restricts searches to the MarkLogic AuditLog.txt events
4747
- *marklogic_error* - restricts searches to the *ErrorLog.txt events
48+
- *marklogic_request* - restricts searches to the *_RequestLog.txt events
4849

4950
You can change these by modifying the *marklogic*, *marklogic_index*, *marklogic_error*, *marklogic_access*,
50-
and *marklogic_audit* macros under *Settings > Advanced search > Search macros*.
51+
*marklogic_request*, and *marklogic_audit* macros under *Settings > Advanced search > Search macros*.
5152

5253
## Getting Help
5354
Submit issues or feature requests at https://github.com/marklogic-community/marklogic-monitoring-for-splunk/issues

0 commit comments

Comments
 (0)