dirty but its tailing.. need to regex out the RGB stuff (@54;>65=85 38?5@A5B8:)
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
module github.com/starkers/safer-eve
|
module github.com/starkers/safer-eve
|
||||||
|
|
||||||
require (
|
require (
|
||||||
fyne.io/fyne v1.1.2
|
|
||||||
github.com/ChimeraCoder/gojson v1.1.0 // indirect
|
github.com/ChimeraCoder/gojson v1.1.0 // indirect
|
||||||
github.com/Jeffail/gabs/v2 v2.2.0
|
github.com/fsnotify/fsnotify v1.4.7 // indirect
|
||||||
github.com/hpcloud/tail v1.0.0
|
github.com/hpcloud/tail v1.0.0
|
||||||
github.com/leaanthony/mewn v0.10.7
|
github.com/leaanthony/mewn v0.10.7
|
||||||
|
github.com/papertrail/go-tail v0.0.0-20180509224916-973c153b0431
|
||||||
github.com/radovskyb/watcher v1.0.7
|
github.com/radovskyb/watcher v1.0.7
|
||||||
|
github.com/tideland/golib v4.24.2+incompatible // indirect
|
||||||
github.com/wailsapp/wails v0.19.0
|
github.com/wailsapp/wails v0.19.0
|
||||||
gopkg.in/fsnotify.v1 v1.4.7 // indirect
|
gopkg.in/fsnotify.v1 v1.4.7 // indirect
|
||||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
|
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ github.com/dchest/jsmin v0.0.0-20160823214000-faeced883947 h1:Fm10/KNuoAyBm2P5P5
|
|||||||
github.com/dchest/jsmin v0.0.0-20160823214000-faeced883947/go.mod h1:Dv9D0NUlAsaQcGQZa5kc5mqR9ua72SmA8VXi4cd+cBw=
|
github.com/dchest/jsmin v0.0.0-20160823214000-faeced883947/go.mod h1:Dv9D0NUlAsaQcGQZa5kc5mqR9ua72SmA8VXi4cd+cBw=
|
||||||
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
|
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
|
||||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||||
|
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
|
||||||
|
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||||
github.com/go-gl/gl v0.0.0-20181026044259-55b76b7df9d2 h1:78Hza2KHn2PX1jdydQnffaU2A/xM0g3Nx1xmMdep9Gk=
|
github.com/go-gl/gl v0.0.0-20181026044259-55b76b7df9d2 h1:78Hza2KHn2PX1jdydQnffaU2A/xM0g3Nx1xmMdep9Gk=
|
||||||
github.com/go-gl/gl v0.0.0-20181026044259-55b76b7df9d2/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=
|
github.com/go-gl/gl v0.0.0-20181026044259-55b76b7df9d2/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=
|
||||||
github.com/go-gl/glfw v0.0.0-20181213070059-819e8ce5125f h1:7MsFMbSn8Lcw0blK4+NEOf8DuHoOBDhJsHz04yh13pM=
|
github.com/go-gl/glfw v0.0.0-20181213070059-819e8ce5125f h1:7MsFMbSn8Lcw0blK4+NEOf8DuHoOBDhJsHz04yh13pM=
|
||||||
@@ -66,6 +68,8 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG
|
|||||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
|
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
|
||||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
||||||
|
github.com/papertrail/go-tail v0.0.0-20180509224916-973c153b0431 h1:i1egM7gz4bPxLCIwBJOkpk6TqHpjTnL4dE1xdN/4dcs=
|
||||||
|
github.com/papertrail/go-tail v0.0.0-20180509224916-973c153b0431/go.mod h1:dMID0RaS2a5rhpOjC4RsAKitU6WGgkFBZnPVffL69b8=
|
||||||
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98=
|
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98=
|
||||||
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA=
|
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA=
|
||||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
@@ -90,6 +94,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
|
|||||||
github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
github.com/syossan27/tebata v0.0.0-20180602121909-b283fe4bc5ba h1:2DHfQOxcpWdGf5q5IzCUFPNvRX9Icf+09RvQK2VnJq0=
|
github.com/syossan27/tebata v0.0.0-20180602121909-b283fe4bc5ba h1:2DHfQOxcpWdGf5q5IzCUFPNvRX9Icf+09RvQK2VnJq0=
|
||||||
github.com/syossan27/tebata v0.0.0-20180602121909-b283fe4bc5ba/go.mod h1:iLnlXG2Pakcii2CU0cbY07DRCSvpWNa7nFxtevhOChk=
|
github.com/syossan27/tebata v0.0.0-20180602121909-b283fe4bc5ba/go.mod h1:iLnlXG2Pakcii2CU0cbY07DRCSvpWNa7nFxtevhOChk=
|
||||||
|
github.com/tideland/golib v4.24.2+incompatible h1:QYMkA3Sr1G8UWJTDsptrLOUwB6N89ETlVBnK5lZXKAw=
|
||||||
|
github.com/tideland/golib v4.24.2+incompatible/go.mod h1:HPHOmtCdCHUQiGAVZnlOH5eNTAEmM7R9oCFXdgvkB+Y=
|
||||||
github.com/wailsapp/wails v0.19.0 h1:Sc4huW7U5SmE6NBwtjvATFqJT3hG1xP+/PYoCCY2Mss=
|
github.com/wailsapp/wails v0.19.0 h1:Sc4huW7U5SmE6NBwtjvATFqJT3hG1xP+/PYoCCY2Mss=
|
||||||
github.com/wailsapp/wails v0.19.0/go.mod h1:CEmTAETH2Z9/mW6rf8pqWcMajql2AKi789uBD24z7nU=
|
github.com/wailsapp/wails v0.19.0/go.mod h1:CEmTAETH2Z9/mW6rf8pqWcMajql2AKi789uBD24z7nU=
|
||||||
golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ func main() {
|
|||||||
for _, f := range fileList{
|
for _, f := range fileList{
|
||||||
if eve.IsCurrentLog(f) {
|
if eve.IsCurrentLog(f) {
|
||||||
//if strings.Contains(f, "delve.imperium") {
|
//if strings.Contains(f, "delve.imperium") {
|
||||||
fmt.Printf("tailing file: %v\n", f)
|
// fmt.Printf("tailing file: %v\n", f)
|
||||||
go eve.Tail(f)
|
go eve.Tail(f)
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|||||||
+47
-1
@@ -5,15 +5,31 @@ import (
|
|||||||
"github.com/hpcloud/tail"
|
"github.com/hpcloud/tail"
|
||||||
"github.com/radovskyb/watcher"
|
"github.com/radovskyb/watcher"
|
||||||
"log"
|
"log"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Tail(file string) {
|
func Tail(file string) {
|
||||||
// https://godoc.org/github.com/hpcloud/tail#Config
|
// https://godoc.org/github.com/hpcloud/tail#Config
|
||||||
|
//t, err := follower.New(file, follower.Config{
|
||||||
|
// Whence: io.SeekEnd,
|
||||||
|
// //Offset: 0,
|
||||||
|
// Reopen: true,
|
||||||
|
//})
|
||||||
|
//t, err := scroller.NewScroller(file)
|
||||||
|
|
||||||
|
stats, err := os.Stat(file)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
|
}
|
||||||
|
size := stats.Size()
|
||||||
|
|
||||||
t, err := tail.TailFile(
|
t, err := tail.TailFile(
|
||||||
file,
|
file,
|
||||||
tail.Config{
|
tail.Config{
|
||||||
Follow: true,
|
Follow: true,
|
||||||
|
Location: &tail.SeekInfo{Offset: size, Whence: 0},
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
@@ -26,16 +42,46 @@ func Tail(file string) {
|
|||||||
|
|
||||||
//currentLine := 0
|
//currentLine := 0
|
||||||
for line := range t.Lines {
|
for line := range t.Lines {
|
||||||
|
|
||||||
|
|
||||||
|
BasicLineParse(line.Text)
|
||||||
//fmt.Printf("%v/%v", currentLine, totalLines)
|
//fmt.Printf("%v/%v", currentLine, totalLines)
|
||||||
//currentLine ++
|
//currentLine ++
|
||||||
//if currentLine > totalLines {
|
//if currentLine > totalLines {
|
||||||
fmt.Printf("##%v##%v##\n", line.Time, line.Text)
|
// fmt.Printf("##%v##%v##\n", line.Time, line.Text)
|
||||||
//}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clean the eve log format a little
|
||||||
|
func BasicLineParse(input string) {
|
||||||
|
|
||||||
|
//// Make a Regex to say we only want letters and numbers
|
||||||
|
//reg, err := regexp.Compile("[^a-zA-Z0-9 ./+-_=]+")
|
||||||
|
//if err != nil {
|
||||||
|
// log.Fatal(err)
|
||||||
|
//}
|
||||||
|
//processedString := reg.ReplaceAllString(input, "")
|
||||||
|
|
||||||
|
splitBySpaces := strings.Split(input, " ")
|
||||||
|
//runedString := []rune(splitBySpaces)
|
||||||
|
|
||||||
|
// count how many characters.. minus the 20 at the end
|
||||||
|
// EG:
|
||||||
|
// "Rookie Help_20191218_161504.txt"
|
||||||
|
// becomes: "Rookie Help"
|
||||||
|
//chars := len(c) - 20
|
||||||
|
//myShortString := string(c[0:chars])
|
||||||
|
|
||||||
|
//fmt.Printf("#%v# |%v| @%v@\n\n",a[1], a[2], a[3:])
|
||||||
|
fmt.Printf("%s\n", splitBySpaces[4:])
|
||||||
|
//return "asdasd"
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// sends newly created files for tail'ing
|
// sends newly created files for tail'ing
|
||||||
// WIP
|
// WIP
|
||||||
|
|||||||
Reference in New Issue
Block a user