Skip to content

Commit 2755f01

Browse files
committed
Prepare app for release
1 parent 0d41b1f commit 2755f01

File tree

3 files changed

+132
-0
lines changed

3 files changed

+132
-0
lines changed

xmlutils/README

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
xmlutils provides a few commands for working with xml documents. xmlkv and xpath can accomplish most tasks, these are simply alternatives.
2+
3+
These commands will work on a field called "xml" if found, otherwise _raw.
4+
5+
xmlprettyprint
6+
xmlprettyprint does what you would expect, pretty printing the xml.
7+
8+
xmlsplit
9+
xmlsplit splits nodes into new events, copying other fields on the event to the new events.
10+
11+
Examples:
12+
Given this xml:
13+
<a><b>foo</b><b>bar</b></a>
14+
15+
xmlsplit field="b"
16+
will create two events:
17+
<b>foo</b> <b>bar</b>
18+
19+
xmlkvrecursive
20+
xmlkvrecursive recursively builds fields from the tag and attribute names. The optional boolean flatten determines how repeated fields are treated. By default, repeated field names will be appended into a multi-value field. With flatten="true", new fields will be created.
21+
22+
Examples:
23+
sourcetype=* | head 1 | eval _raw="<a la='sdf'><b>foo</b><b>bar</b></a>" | xmlkvrecursive
24+
produces:
25+
a-la = sdf a_b = [foo,bar]
26+
27+
sourcetype=* | head 1 | eval _raw="<a la='sdf'><b>foo</b><b>bar</b></a>" | xmlkvrecursive flatten=true
28+
produces:
29+
a-la = sdf a_b = foo a_b[2](http://splunkbase.splunk.com/wiki/2) = bar
30+
31+
Most of the time, xpath or xmlkv would be more appropriate. This command is useful if you need to extract multiple fields that are not extracted easily using one of those commands.
32+
33+
xmlstripdeclaration
34+
xmlstripdeclaration removes the <?xml declaration from the beginning of the xml. This is needed if the declaration is incorrect and the parser used by the other commands would refuse to continue.

xmlutils/app.manifest

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"schemaVersion": "2.0.0",
3+
"info": {
4+
"title": "xmlutils",
5+
"id": {
6+
"group": null,
7+
"name": "xmlutils",
8+
"version": "1.2.0"
9+
},
10+
"author": [
11+
{
12+
"name": "vbumgarner",
13+
"email": null,
14+
"company": null
15+
}
16+
],
17+
"releaseDate": null,
18+
"description": "XML utilities",
19+
"classification": {
20+
"intendedAudience": null,
21+
"categories": [],
22+
"developmentStatus": null
23+
},
24+
"commonInformationModels": null,
25+
"license": {
26+
"name": null,
27+
"text": null,
28+
"uri": null
29+
},
30+
"privacyPolicy": {
31+
"name": null,
32+
"text": null,
33+
"uri": null
34+
},
35+
"releaseNotes": {
36+
"name": null,
37+
"text": null,
38+
"uri": null
39+
}
40+
},
41+
"dependencies": null,
42+
"tasks": null,
43+
"inputGroups": null,
44+
"incompatibleApps": null,
45+
"platformRequirements": null,
46+
"supportedDeployments": [
47+
"_standalone",
48+
"_distributed"
49+
],
50+
"targetWorkloads": null
51+
}
52+
# The following sections can be customized and added to the manifest. For detailed information,
53+
# see the documentation at http://dev.splunk.com/view/packaging-toolkit/SP-CAAAE9V
54+
#
55+
# Lists the app dependencies and version requirements
56+
# "dependencies": {
57+
# "<app-group>:<app-name>": {
58+
# "version": "*",
59+
# "package": "<source-package-name>",
60+
# "optional": [true|false]
61+
# }
62+
# }
63+
#
64+
# Lists the inputs that belong on the search head rather than forwarders
65+
# "tasks": []
66+
#
67+
# Lists the possible input groups with app dependencies, and inputs that should be included
68+
# "inputGroups": {
69+
# "<group-name>": {
70+
# "requires": {
71+
# "<app-group>:<app-name>": ["<dependent-input-groups>"]
72+
# },
73+
# "inputs": ["<defined-inputs>"]
74+
# }
75+
# }
76+
#
77+
# Lists the app IDs that cannot be installed on the system alongside this app
78+
# "incompatibleApps": {
79+
# "<app-group>:<app-name>": "<version>"
80+
# }
81+
#
82+
# Specify the platform version requirements for this app
83+
# "platformRequirements": {
84+
# "splunk": {
85+
# "Enterprise": "<version>"
86+
# }
87+
# }
88+
#
89+
# Lists the supported deployment types this app can be installed on
90+
# "supportedDeployments": ["*" | "_standalone" | "_distributed" | "_search_head_clustering"]
91+
#
92+
# Lists the targets where app can be installed to
93+
# "targetWorkloads": ["*" | "_search_heads" | "_indexers" | "_forwarders"]
94+
#

xmlutils/default/commands.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
[xmlkvrecursive]
2+
python.version = python3
23
filename = xmlkvrecursive.py
34
retainsevents = true
45
overrides_timeorder = false
56
streaming = true
67

78
[xmlsplit]
9+
python.version = python3
810
filename = xmlsplit.py
911
retainsevents = true
1012
overrides_timeorder = false
1113
run_in_preview = false
1214
streaming = true
1315

1416
[xmlprettyprint]
17+
python.version = python3
1518
filename = xmlprettyprint.py
1619
retainsevents = true
1720
overrides_timeorder = false
1821
run_in_preview = false
1922
streaming = true
2023

2124
[xmlstripdeclaration]
25+
python.version = python3
2226
filename = xmlstripdeclaration.py
2327
retainsevents = true
2428
overrides_timeorder = false

0 commit comments

Comments
 (0)