Code Monkey home page Code Monkey logo

logconv's Introduction

ログデータ解析用Powershellスクリプト

65万行ほどあるログデータの中から必要なデータを抽出して時系列にまとめたうえで16進→10進変換するPowershellスクリプト。

入力データ仕様

1レコードあたり5フィールドのcsvファイル。

  • 第1フィールド:時刻データ(hh:mm:ss.sss)。250msec毎のログ。
  • 第2フィールド:データステータス。今回抽出するのはここが35[0-2]の値を持つもの。
  • 第3フィールド:???
  • 第4フィールド:???
  • 第5フィールド:8組の2バイトデータ。セパレータは空白。
"Time","Identifier (hex)","Format","Flags","Data (hex)"
"00:02:21.085","305","Std","","10 12 10 13 10 13 10 10"
"00:02:21.085","306","Std","","10 0A 10 0B 10 0C 10 01"
"00:02:21.086","307","Std","","10 0A 10 07 10 06 10 08"
"00:02:21.086","308","Std","","10 12 10 13 10 12 10 0F"
"00:02:21.086","309","Std","","10 11 10 11 10 11 10 10"
"00:02:21.087","30A","Std","","10 0F 10 14 10 11 10 13"
"00:02:21.087","30B","Std","","10 14 10 14 10 0F 10 12"
"00:02:21.087","350","Std","","1F 1F 00 00 1E 1F 00 00"
"00:02:21.088","351","Std","","1E 1E 00 00 1E 1E 00 00"
"00:02:21.088","352","Std","","1F 1F 00 00 1F 1F 00 00"

出力データ仕様

1レコードあたり13フィールドのcsvファイル。

  • 第1フィールド:時刻データ(hh:mm:ss.s)。ミリ秒単位のズレを切り捨て。
  • 第2フィールド:データステータスが350の第5フィールド1番目の10進値。
  • 第3フィールド:データステータスが350の第5フィールド2番目の10進値。
  • 第4フィールド:データステータスが350の第5フィールド5番目の10進値。
  • 第5フィールド:データステータスが350の第5フィールド6番目の10進値。
  • 第6フィールド:データステータスが351の第5フィールド1番目の10進値。
  • 第7フィールド:データステータスが351の第5フィールド2番目の10進値。
  • 第8フィールド:データステータスが351の第5フィールド5番目の10進値。
  • 第9フィールド:データステータスが351の第5フィールド6番目の10進値。
  • 第10フィールド:データステータスが352の第5フィールド1番目の10進値。
  • 第11フィールド:データステータスが352の第5フィールド2番目の10進値。
  • 第12フィールド:データステータスが352の第5フィールド5番目の10進値。
  • 第13フィールド:データステータスが352の第5フィールド6番目の10進値。
00:10:10.9,35,36,35,35,35,36,35,35,36,37,37,37
00:10:11.9,35,36,35,35,35,36,35,35,36,36,37,37
00:10:12.9,35,36,35,35,35,36,35,35,36,37,37,37
00:10:13.9,35,35,35,35,35,35,35,35,36,36,37,37
00:10:14.9,35,36,35,35,35,36,35,35,36,36,37,37
00:10:15.9,35,36,35,35,35,36,35,35,36,36,37,37
00:10:16.9,35,36,35,35,35,36,35,35,36,37,37,37
00:10:17.9,35,36,35,35,35,36,35,35,36,37,37,37
00:10:18.9,35,36,35,35,35,36,35,35,36,36,37,37
00:10:19.9,35,36,35,35,35,36,35,35,36,36,37,37

License

This script has released under the MIT license.
http://opensource.org/licenses/MIT

logconv's People

Contributors

takeru-chan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.