Skip to content

Commit 3d0e5ff

Browse files
committed
Add bash script for applying the Slack 'parser'
1 parent adb71bd commit 3d0e5ff

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

parse_logs.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (C) 2015 Elana Hashman
4+
#
5+
# This program is free software; you can redistribute it and/or
6+
# modify it under the terms of the GNU General Public License
7+
# as published by the Free Software Foundation; either version 2
8+
# of the License, or (at your option) any later version.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program; if not, see <http://www.gnu.org/licenses/>.
17+
18+
19+
# Given root Slack export directory, create logs/ directory and
20+
# search the current directory for all json files in
21+
# dir/YYYY-MM-DD.json form. Create dir-YYYY-MM-DD.log in logs/.
22+
23+
mkdir -p logs
24+
for file in `find . -name '[-0-9]*.json'`; do
25+
filename=${file:2}
26+
filename=${filename/\//-}
27+
./slack_parse.py $file > logs/${filename%json}log
28+
done

0 commit comments

Comments
 (0)