Giter Site home page Giter Site logo

Comments (3)

gilly3 avatar gilly3 commented on May 12, 2024

Here's how I had to adjust the schema and regex in order to get the table to include log entries containing 504 responses:

CREATE EXTERNAL TABLE IF NOT EXISTS default.elb_logs (
  `request_timestamp` string,
  `elb_name` string,
  `request_ip` string,
  `request_port` int,
  `backend_ip_port` string,
  `request_processing_time` double,
  `backend_processing_time` double,
  `client_response_time` double,
  `elb_response_code` string,
  `backend_response_code` string,
  `received_bytes` bigint,
  `sent_bytes` bigint,
  `request_verb` string,
  `url` string,
  `protocol` string,
  `user_agent` string,
  `ssl_cipher` string,
  `ssl_protocol` string 
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
WITH SERDEPROPERTIES (
  'serialization.format' = '1',
  'input.regex' = '([^ ]*) ([^ ]*) ([^ ]*):([0-9]*) ([^ ]*) (-1|[.0-9]*) (-1|[.0-9]*) (-1|[.0-9]*) (-|[0-9]*) (-|[0-9]*) ([-0-9]*) ([-0-9]*) \"([^ ]*) ([^ ]*) (- |[^ ]*)\" (\"[^\"]*\") ([A-Z0-9-]+) ([A-Za-z0-9.-]*)$'
) LOCATION 's3://your_log_bucket/prefix/AWSLogs/AWS_account_ID/elasticloadbalancing/'
TBLPROPERTIES ('has_encrypted_data'='false')

from amazon-athena-user-guide.

JuliaMalkin avatar JuliaMalkin commented on May 12, 2024

Hi gilly3!
Sorry for the delays in responding. Thank you for reaching out. You raised absolutely valid points and we are looking into it. I will post here once I have more information, hopefully shortly. Thanks again for writing to us! Will keep it open for now.

from amazon-athena-user-guide.

JuliaMalkin avatar JuliaMalkin commented on May 12, 2024

Hi Ivan,
I consulted with the team and they agreed with your issue. Thank you for reporting it. They suggested a slightly different REGEX. Please see the updated topic with the example query. I will close this request without accepting a pull request, only because their solution is different, even though it addresses the same issue. Please do write back to us and let us know if you notice other issues! Thank you, as always. Also, I am sorry for the delays!

from amazon-athena-user-guide.

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.