<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question How to convert unix timestamp to datetime in Apache NiFi? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-convert-unix-timestamp-to-datetime-in-Apache-NiFi/m-p/224738#M186602</link>
    <description>&lt;P&gt;Hi everyone!
&lt;BR /&gt;In my FlowFile, using components, I listen to logs from Squid in the form of txt. Then I add columns and separate the log elements. The output file is csv, because in the future it will be added to the Hive database.
&lt;BR /&gt;The problem occurs when I want to change the type of the "datetime" variable from unix timestamp to the usual date time.&lt;/P&gt;&lt;P&gt;Based on this solution: &lt;A href="https://community.hortonworks.com/articles/131320/using-partitionrecord-grokreaderjsonwriter-to-pars.html"&gt;https://community.hortonworks.com/articles/131320/using-partitionrecord-grokreaderjsonwriter-to-pars.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This is how the log sent by Squid looks like using a proxy:&lt;/P&gt;&lt;P&gt;1518442283.483     161 127.0.0.1 TCP_MISS/200 103701 GET &lt;A href="http://www.cnn.com/" target="_blank"&gt;http://www.cnn.com/&lt;/A&gt; matt DIRECT/199.27.79.73 text/html&lt;/P&gt;&lt;P&gt;This is Grok Expression (in &lt;STRONG&gt;GrokReader&lt;/STRONG&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;%{NUMBER:timestamp}\s+%{NUMBER:duration}\s%{IP:client_address}\s%{WORD:cache_result}/%{POSINT:status_code}\s%{NUMBER:bytes}\s%{WORD:request_method}\s%{NOTSPACE:url}\s(%{NOTSPACE:user}|-)\s%{WORD:hierarchy_code}/%{IPORHOST:server}\s%{NOTSPACE:content_type}&lt;/P&gt;&lt;P&gt;The following links include:&lt;BR /&gt;→ General appearance of components: &lt;A href="https://imgur.com/a/fn2Q03N" target="_blank"&gt;https://imgur.com/a/fn2Q03N&lt;/A&gt;&lt;BR /&gt;→ Settings for the UpdateRecord component: &lt;A href="https://imgur.com/a/E8gfMj8" target="_blank"&gt;https://imgur.com/a/E8gfMj8&lt;/A&gt;&lt;BR /&gt;→ Settings for the UpdateRecord/GrokReader(nifi_mid): &lt;A href="https://imgur.com/a/l8He75D" target="_blank"&gt;https://imgur.com/a/l8He75D&lt;/A&gt;&lt;BR /&gt;→ Settings for the UpdateRecord/CSVRecordSetWriter: &lt;A href="https://imgur.com/a/aqiZ98M" target="_blank"&gt;https://imgur.com/a/aqiZ98M&lt;/A&gt;&lt;/P&gt;&lt;P&gt;My problem is described on stackoverflow: &lt;A href="https://stackoverflow.com/questions/48885675/conversion-unix-timestamp-attribute-to-normal-date" target="_blank"&gt;https://stackoverflow.com/questions/48885675/conversion-unix-timestamp-attribute-to-normal-date&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Apr 2018 20:31:52 GMT</pubDate>
    <dc:creator>wojciech_leszcz</dc:creator>
    <dc:date>2018-04-20T20:31:52Z</dc:date>
  </channel>
</rss>

