<?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>topic Re: Source type to use  for postgresql log in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/What-would-be-the-source-type-I-use-for-postgresql-logs/m-p/45110#M8465</link>
    <description>&lt;P&gt;Splunk only has pretrained sourcetypes for mysql, specifically these data sources:&lt;/P&gt;

&lt;P&gt;Databases   mysqld, mysqld_error, mysqld_bin&lt;/P&gt;

&lt;P&gt;For Postgresql,  you should make a new sourcetype, I use "postgresql" then set the appropriate props.conf to that sourcetype to extract the fields properly.  &lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 15:38:51 GMT</pubDate>
    <dc:creator>khourihan_splun</dc:creator>
    <dc:date>2020-09-28T15:38:51Z</dc:date>
    <item>
      <title>What would be the source type I use for postgresql logs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-would-be-the-source-type-I-use-for-postgresql-logs/m-p/45109#M8464</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;What would be the source type I use for postgresql logs?&lt;/P&gt;
&lt;P&gt;Here's a single line on the log file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;2013-02-27 18:36:01.103858 EST,"builder","dw",p13175,th-846481664,"10.24.33.81","44591",2013-02-27 18:35:54 EST,6827524,con243135,cmd70,seg-1,,dx1628096,x6827524,sx1,"LOG","00000","statement: SELECT quote_ident(E'subscribersnapshot_sample_ss539')",,,,,,"SELECT quote_ident(E'subscribersnapshot_sample_ss539')",0,,"postgres.c",1542,
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;lupin&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 17:04:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-would-be-the-source-type-I-use-for-postgresql-logs/m-p/45109#M8464</guid>
      <dc:creator>lupindeterd</dc:creator>
      <dc:date>2023-04-05T17:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Source type to use  for postgresql log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-would-be-the-source-type-I-use-for-postgresql-logs/m-p/45110#M8465</link>
      <description>&lt;P&gt;Splunk only has pretrained sourcetypes for mysql, specifically these data sources:&lt;/P&gt;

&lt;P&gt;Databases   mysqld, mysqld_error, mysqld_bin&lt;/P&gt;

&lt;P&gt;For Postgresql,  you should make a new sourcetype, I use "postgresql" then set the appropriate props.conf to that sourcetype to extract the fields properly.  &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:38:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-would-be-the-source-type-I-use-for-postgresql-logs/m-p/45110#M8465</guid>
      <dc:creator>khourihan_splun</dc:creator>
      <dc:date>2020-09-28T15:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Action field  to use  for postgresql log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-would-be-the-source-type-I-use-for-postgresql-logs/m-p/638857#M109091</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;In postgresql logs we get most of field extracted but i need to have column for action as well which needs to be extracted :&lt;/P&gt;&lt;P&gt;example :&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;2023-04-05&lt;/SPAN&gt; &lt;SPAN class=""&gt;1:42:25&lt;/SPAN&gt; &lt;SPAN class=""&gt;UTC&lt;/SPAN&gt;&lt;SPAN&gt; [&lt;/SPAN&gt;&lt;SPAN class=""&gt;25804&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt; [&lt;/SPAN&gt;&lt;SPAN class=""&gt;3-1&lt;/SPAN&gt;&lt;SPAN&gt;] &lt;/SPAN&gt;&lt;SPAN class=""&gt;user=pgmon&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;db=postgres&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;app=psql&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;client=&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;local&lt;/SPAN&gt;&lt;SPAN&gt;] &lt;/SPAN&gt;&lt;SPAN class=""&gt;LOG:&lt;/SPAN&gt; &lt;SPAN class=""&gt;AUDIT:&lt;/SPAN&gt; &lt;SPAN class=""&gt;SESSION&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;MISC&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;BEGIN&lt;/SPAN&gt;&lt;SPAN&gt;,,,&lt;/SPAN&gt;&lt;SPAN class=""&gt;BEGIN&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN class=""&gt;SET&lt;/SPAN&gt; &lt;SPAN class=""&gt;statement_timeout=100&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN class=""&gt;COMMIT&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;SPAN class=""&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class=""&gt;version&lt;/SPAN&gt;&lt;SPAN&gt;() &lt;/SPAN&gt;&lt;SPAN class=""&gt;AS&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;2023-04-05&lt;/SPAN&gt; &lt;SPAN class=""&gt;1:42:25&lt;/SPAN&gt; &lt;SPAN class=""&gt;UTC&lt;/SPAN&gt;&lt;SPAN&gt; [&lt;/SPAN&gt;&lt;SPAN class=""&gt;25804&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt; [&lt;/SPAN&gt;&lt;SPAN class=""&gt;2-1&lt;/SPAN&gt;&lt;SPAN&gt;] &lt;/SPAN&gt;&lt;SPAN class=""&gt;user=pgmon&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;db=postgres&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt;app=&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;unknown&lt;/SPAN&gt;&lt;SPAN&gt;],&lt;/SPAN&gt;&lt;SPAN class=""&gt;client=&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;local&lt;/SPAN&gt;&lt;SPAN&gt;] &lt;/SPAN&gt;&lt;SPAN class=""&gt;LOG:&lt;/SPAN&gt; &lt;SPAN class=""&gt;connection&lt;/SPAN&gt; &lt;SPAN class=""&gt;authorized:&lt;/SPAN&gt; &lt;SPAN class=""&gt;user=pgmon&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;database=postgres&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;so if you see i want to have field extracted as Action and value to be Audit/connection authorized etc&lt;/P&gt;&lt;P&gt;values are different all across logs.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 16:22:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-would-be-the-source-type-I-use-for-postgresql-logs/m-p/638857#M109091</guid>
      <dc:creator>shruti14</dc:creator>
      <dc:date>2023-04-05T16:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: What would be the source type I use for postgresql logs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/What-would-be-the-source-type-I-use-for-postgresql-logs/m-p/639064#M109124</link>
      <description>&lt;P&gt;Don't rely on built-in stuff, build it yourself.&amp;nbsp; Pick a sourcetype that makes sense to you.&amp;nbsp; The emerging standard is "vendor:product:type" but it doesn't matter.&amp;nbsp; Then build out your field extractions yourself.&amp;nbsp; Start with setting "KV_MODE=auto" and build out the rest from there.&amp;nbsp; &amp;nbsp;Here is some of that done in SPL but you should NOT do it in SPL, do it in KOs:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="2023-04-05 1:42:25 UTC [25804]: [3-1] user=pgmon,db=postgres,app=psql,client=[local] LOG: AUDIT: SESSION,1,1,MISC,BEGIN,,,BEGIN;SET statement_timeout=100;COMMIT;SELECT version() AS"
| append [| makeresults 
| eval _raw="2023-04-05 1:42:25 UTC [25804]: [2-1] user=pgmon,db=postgres,app=[unknown],client=[local] LOG: connection authorized: user=pgmon database=postgres" ]
| eval _time = strptime(_raw, "%Y-%m-%d %H:%M:%S %Z")
| kv
| rex "\]\s+LOG:\s+(?&amp;lt;action&amp;gt;[^:]+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 06 Apr 2023 18:31:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/What-would-be-the-source-type-I-use-for-postgresql-logs/m-p/639064#M109124</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2023-04-06T18:31:10Z</dc:date>
    </item>
  </channel>
</rss>

