Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.

Commit 34d4207

Browse files
committed
METRON-720 modify generate-md.sh to re-throw errors from within 'find', and
METRON-719 use of quadruple back-ticks in README.md file
1 parent f6c253f commit 34d4207

File tree

2 files changed

+27
-13
lines changed

2 files changed

+27
-13
lines changed

metron-platform/metron-data-management/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Users also have the ability to transform and filter enrichment and threat intel
133133

134134
As an example, we will be providing a CSV list of top domains as an enrichment and filtering the value metadata, as well as the indicator column, with Stellar expressions.
135135

136-
````
136+
```
137137
{
138138
"config" : {
139139
"zk_quorum" : "node1:2181",
@@ -155,7 +155,7 @@ As an example, we will be providing a CSV list of top domains as an enrichment a
155155
},
156156
"extractor" : "CSV"
157157
}
158-
````
158+
```
159159

160160
There are 2 property maps that work with full Stellar expressions, and 2 properties that will work with Stellar predicates.
161161

@@ -167,11 +167,11 @@ There are 2 property maps that work with full Stellar expressions, and 2 propert
167167
| indicator_filter | Allows additional filtering with Stellar predicates based on results from the value transformations. In this example, records whose indicator value is empty after removing the TLD will be omitted. |
168168

169169
top-list.csv
170-
````
170+
```
171171
1,google.com
172172
2,youtube.com
173173
...
174-
````
174+
```
175175

176176
Running a file import with the above data and extractor configuration would result in the following 2 extracted data records:
177177

@@ -182,22 +182,22 @@ Running a file import with the above data and extractor configuration would resu
182182

183183
Similar to the parser framework, providing a Zookeeper quorum via the zk_quorum property will enable Stellar to access properties that reside in the global config.
184184
Expanding on our example above, if the global config looks as follows:
185-
````
185+
```
186186
{
187187
"global_property" : "metron-ftw"
188188
}
189-
````
189+
```
190190

191191
And we expand our value_tranform:
192-
````
192+
```
193193
...
194194
"value_transform" : {
195195
"domain" : "DOMAIN_REMOVE_TLD(domain)",
196196
"a-new-prop" : "global_property"
197197
},
198198
...
199199
200-
````
200+
```
201201

202202
The resulting value data would look like the following:
203203

site-book/bin/generate-md.sh

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,23 @@ echo "Done."
269269
echo " "
270270

271271
echo "Fixing up markdown dialect problems between Github-MD and doxia-markdown:"
272-
find . -name '*.md' -print -exec python "$METRON_SOURCE"/site-book/bin/fix-md-dialect.py '{}' \;
273-
echo "Done."
274-
echo " "
275-
272+
# Detecting errors from a `find -exec` command is difficult, have to use an intermediary file
273+
errfile="../errout.dat"
274+
if [ -e $errfile ]; then
275+
rm -f $errfile
276+
fi
277+
touch $errfile
278+
find . -name '*.md' -print -exec python "$METRON_SOURCE"/site-book/bin/fix-md-dialect.py '{}' \; 2>> $errfile
279+
errlines=`cat $errfile|wc -l`
280+
if (( $errlines > 0 )) ; then
281+
echo "ERROR DETECTED:"
282+
cat $errfile
283+
rm -f $errfile
284+
exit 127
285+
else
286+
rm -f $errfile
287+
echo "Done."
288+
echo " "
289+
exit 0
290+
fi
276291

277-
exit 0

0 commit comments

Comments
 (0)