<?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: Parsing TSV with variable header names in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-TSV-with-variable-header-names/m-p/701423#M116076</link>
    <description>&lt;P&gt;Thanks for confirming my suspicion. SED'ed a lot!&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2024 13:40:17 GMT</pubDate>
    <dc:creator>kristensens</dc:creator>
    <dc:date>2024-10-09T13:40:17Z</dc:date>
    <item>
      <title>Parsing TSV with variable header names</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-TSV-with-variable-header-names/m-p/701226#M116056</link>
      <description>&lt;P&gt;Hi, I've an eventhub that receives data from multiple application, with different number and values of columns.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The events are typically like so (as an example)&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;Environment&lt;/SPAN&gt; &lt;SPAN class=""&gt;ProductName&lt;/SPAN&gt; &lt;SPAN class=""&gt;UtcDate&lt;/SPAN&gt; &amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;RequestId&lt;/SPAN&gt; &lt;SPAN class=""&gt;Clientid ClientIp #app1 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;Environment ProductName UtcDate Instance Region RequestId ClientIp DeviceId #app2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;Environment ProductName UtcDate&amp;nbsp; DeviceId&amp;nbsp;ClientIp #app3&lt;BR /&gt;PROD Product1 2024-04-04T20:21:20 abcd-12345-dev bcde-ed-1234 10.12.13.14   #app1&lt;BR /&gt;PROD Product2 2024-04-04T20:23:20 gwa us 126d-a23d-1234-def1 10.23.45.67 abcAJHSSz12. #ap&lt;BR /&gt;TEST Product3 2024-04-04T20:25:20 Ghsdhg1245 12.34.57.78 #app3&lt;BR /&gt;Environment ProductName UtcDate Instance Region RequestId ClientIp DeviceId #app2&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;#app&amp;nbsp;at end of line, is not part of log, just to annotate the different entrie&lt;BR /&gt;How can splunk automagically select which "format" to use with REPORT/EXTRACT in transforms?&lt;BR /&gt;&lt;BR /&gt;On the HeavyForwarder&amp;nbsp;&lt;BR /&gt;transforms.conf&lt;/P&gt;&lt;PRE&gt;[header1]&lt;BR /&gt;DELIMS="\t"&lt;BR /&gt;FIELDS=&lt;SPAN&gt;Environment,&lt;/SPAN&gt;&lt;SPAN&gt;ProductName,&lt;/SPAN&gt;&lt;SPAN&gt;UtcDate,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;RequestId,&lt;/SPAN&gt;&lt;SPAN&gt;Clientid,&lt;/SPAN&gt;&lt;SPAN&gt;ClientIp&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;[header2]&lt;BR /&gt;DELIMS="\t"&lt;BR /&gt;FIELDS=Environment,&lt;SPAN&gt;ProductName,&lt;/SPAN&gt;&lt;SPAN&gt;UtcDate,&lt;/SPAN&gt;&lt;SPAN&gt;Instance,&lt;/SPAN&gt;&lt;SPAN&gt;Region,&lt;/SPAN&gt;&lt;SPAN&gt;RequestId,&lt;/SPAN&gt;&lt;SPAN&gt;ClientIp,&lt;/SPAN&gt;&lt;SPAN&gt;DeviceId&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;[header3]&lt;BR /&gt;DELIMS="\t"&lt;BR /&gt;FIELDS=Environment,&lt;SPAN&gt;ProductName,&lt;/SPAN&gt;&lt;SPAN&gt;UtcDate&amp;nbsp;,&lt;/SPAN&gt;&lt;SPAN&gt;DeviceId&amp;nbsp;ClientIp&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;In props.conf&lt;/P&gt;&lt;PRE&gt;[eventhub:sourcewithmixedsources]&lt;BR /&gt;INDEXED_EXTRACTIONS = TSV&lt;BR /&gt;CHECK_FOR_HEADER=true&lt;BR /&gt;NO_BINARY_CHECK = 1&lt;BR /&gt;SHOULD_LINEMERGE = false&lt;BR /&gt;pulldown_type = 1&lt;BR /&gt;REPORT-headers = header1, header3,header3&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 18:59:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-TSV-with-variable-header-names/m-p/701226#M116056</guid>
      <dc:creator>kristensens</dc:creator>
      <dc:date>2024-10-07T18:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing TSV with variable header names</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-TSV-with-variable-header-names/m-p/701238#M116058</link>
      <description>&lt;P&gt;1. If you're doing indexed extractions, your data is processed as parsed. Adding search-time extractions will only result in double fields (or misassigned fields in case of not-well-defined formats).&lt;/P&gt;&lt;P&gt;2. In general, unless you have a file input with header specifying fields within that file there's no way to assign fields dynamically to indexed-extraction fields.&lt;/P&gt;&lt;P&gt;3. You could try making search-time extraction definitions that match only specific message templates.&lt;/P&gt;&lt;P&gt;Like&lt;/P&gt;&lt;PRE&gt;REPORT-fields-for-app1 = ^(?&amp;lt;Environment&amp;gt;\S+)\s+(?&amp;lt;ProductName&amp;gt;\S+)\s+\(?&amp;lt;UtcDate&amp;gt;\S+)\s+(&amp;lt;RequestId&amp;gt;\S+)\s+(?&amp;lt;ClientId&amp;gt;\S+)\s+(?&amp;lt;ClientIp&amp;gt;\d+\.\d+\.\d+\.\d+)$&lt;/PRE&gt;&lt;P&gt;This should match only data for app1 because it has specific number of whitespace-separated files and has IP value anchored in a particular place within an event. You can have several other similar extraction definitions, each covering separate event template.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 20:32:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-TSV-with-variable-header-names/m-p/701238#M116058</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-10-07T20:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing TSV with variable header names</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-TSV-with-variable-header-names/m-p/701423#M116076</link>
      <description>&lt;P&gt;Thanks for confirming my suspicion. SED'ed a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 13:40:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-TSV-with-variable-header-names/m-p/701423#M116076</guid>
      <dc:creator>kristensens</dc:creator>
      <dc:date>2024-10-09T13:40:17Z</dc:date>
    </item>
  </channel>
</rss>

