GithubHelp home page GithubHelp logo

Comments (2)

nielsbasjes avatar nielsbasjes commented on June 14, 2024

Try changing your logformat to replace the %t with the appropriate %{format}t value.
Here you can find the supported fields: https://github.com/nielsbasjes/logparser/blob/master/httpdlog/httpdlog-parser/src/main/java/nl/basjes/parse/httpdlog/dissectors/StrfTimeStampDissector.java#L200

Looking at your example I would guess something like this: %{%d/%b/%Y:%H:%M:%S %z}t

from logparser.

nielsbasjes avatar nielsbasjes commented on June 14, 2024

To verify I added an extra test in the code base with this timestamp.
This works as I expect it to work:

    @Test
    public void testReportedSpecialTime() throws Exception {
        String logline = "28/feb/2017:03:39:40 +0800";
        String logformat = "%{%d/%b/%Y:%H:%M:%S %z}t";

        DissectorTester.create()
            .withDissector(new HttpdLogFormatDissector(logformat))
            .withInput(logline)
            .expect("TIME.EPOCH:request.receive.time.epoch", "1488224380000")
            .checkExpectations();
    }

I verified the result using this
https://www.epochconverter.com/timezones?q=1488224380&tz=Asia%2FHong_Kong

from logparser.

Related Issues (20)

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.