Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Simple Structured Log Format "SSON"

Simple Structured Log Format "SSON"

RubyHiroba2013 Lightning Talks
公開版資料なので発表時とは一部スライドが異なっております。

3f1fad1dcac9f7e38db511df060a192d?s=128

Toshiaki Koshiba

June 02, 2013
Tweet

Transcript

  1. ϗϯτʹγϯϓϧͳߏ଄Խ ϩάϑΥʔϚοτ440/ͷ ͝ఏҊ ౦ژ࿷SSONϢʔβձ ͜͠͹ ͱ͖͋͠ എܠը૾IUUQDPNNPOTOJDPWJEFPKQNBUFSJBMOD

  2. 3VCZ)JSPCBελοϑ 3VCZ,BKBൃද࢘ձ ౦ژ3VCZձ࣮ٞߦҕһ௕ 4IJCVZBSC ג 70:"(&(3061ΞδϟΠϧઓུࣨ ג ;VDLT޿ࠂ഑৴ۀΤϯδχΞ ͜͠͹ͱ͖͋͠ !CBTI$

  3. IUUQEIBUFOBOFKQCBTI$

  4. IUUQEIBUFOBOFKQCBTI$

  5. IUUQTUXJUUFSDPNZVGV@50.Z5VNCMS

  6. IUUQEIBUFOBOFKQCBTI$UXFFGGZ

  7. ͲΜͳϩάϑΥʔϚοτ ࢖ͬͯΔʁ

  8. Combinedɺݻఆ௕ɺλϒจࣈ۠ ੾Γɺnullจࣈ۠੾ΓɺJSON…

  9. IUUQXXXTMJEFTIBSFOFUSFKBTVQPUBSPT

  10. IUUQXXXTMJEFTIBSFOFUSFKBTVQPUBSPT

  11. IUUQXXXTMJEFTIBSFOFUSFKBTVQPUBSPT

  12. SSON

  13. Simple Sexp Object Notation

  14. (("time" 1362020400)("NAME" "KOSHIBA")("AGE" 32)("HOGE" "fuga"))

  15. RubyͰSࣜΛѻ͏

  16. IUUQXXXOBNJLJMBCUVBUBDKQdTBTBEBQSPH SVDIFNFIUNM

  17. IUUQPMEUZQFTVNJCJPSHTIPXQBHF/FOEP

  18. SSONͰॻ͖ͩ͢

  19. require ‘nendo’ core = Nendo::Core.new core.loadInitFile core.evalStr( '(define (sexpToString sexp)

    (write-to-string sexp))' ) core.evalStr( '(export-to-ruby sexpToString)' ) list = {hoge: 123}.to_list core.sexpToString(list) #=> "((hoge . 123))"
  20. qVFOUQMVHJO UBJMTTPO IUUQTHJUIVCDPNCBTI$qVFOUQMVHJOUBJMTTPO

  21. in_tailͰJSON ಡΉͷͱಉ͡Α͏ʹ SSONಡΊΔΑ

  22. <source> type tail_sson path /path/to/sson.log tag tail.sson format sson </source>

  23. let(:text) {'(("time" 1362020400)("NAME" "KOSHIBA")("AGE" 32))'} ʻ৭ʑུʼ context do let(:time) {result.first}

    it {time.should == 1362020400} end context do let(:hash) {result.last} it do hash.size.should == 3 hash['NAME'].should == 'KOSHIBA' hash['AGE'].should == 32 hash['HOGE'].should == 'fuga' end end
  24. 4JNQMF

  25. ͓ئ͍͝ͱ

  26. ·ͩ·ͩ͸͡ ·ͬͯͳ͍ʂ

  27. ར༻ɺϥΠϒϥϦ࡞੒ɺύϑΥʔ Ϛϯεଌఆɺͦͷଞ΋Ζ΋Ζ

  28. ղܾ͢΂͖ ໰୊΋ ͢Ͱʹ͋Δ IUUQTUXJUUFSDPNUBHPNPSJTTUBUVT

  29. ͝ॿྗ͓·ͪ ͍ͯ͠·͢ʂ