<?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: Regex to query csv raw data in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695300#M236436</link>
    <description>&lt;P&gt;It depends on what you events look like i.e. what the fields are called and what is in them. You should give more accurate information as I don't have access to your data and only know what you have shared so far.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Aug 2024 16:00:10 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2024-08-05T16:00:10Z</dc:date>
    <item>
      <title>Regex to query csv raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695259#M236427</link>
      <description>&lt;P&gt;I have a CSV raw data which has files names and data inside the files which is seperated by double quotes and comma.&amp;nbsp; I am trying to create following regex&amp;nbsp; (^\"(?&amp;lt;file_name&amp;gt;\w.*)\"\,\"(?&amp;lt;links_emb&amp;gt;\w.*)\") which is taking results as one event and results. Due to which count is mismaching.&amp;nbsp; One event has multiple CSV data mentioned below and few events has one file name and data inside the file name.&amp;nbsp; One file containts multiple files types.&amp;nbsp; Can you help me with regex which can can take one line as one event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"filename_Time15151515.html","&lt;A href="http://testdata1.html" target="_blank"&gt;http://testdata1.html&lt;/A&gt;"&lt;BR /&gt;"filename_Time15151515.html","&lt;A href="http://testdata2.gif" target="_blank"&gt;http://testdata2.gif&lt;/A&gt;"&lt;BR /&gt;"filename_Time15151515.html",""&lt;A href="http://testdata3.doc" target="_blank"&gt;http://testdata3.doc&lt;/A&gt;"&lt;BR /&gt;"filename_Time15151515.html",""&lt;A href="http://testdata4.xls" target="_blank"&gt;http://testdata4.xls&lt;/A&gt;"&lt;BR /&gt;"filename_Time15151515.html",""&lt;A href="http://testdata5.aspx" target="_blank"&gt;http://testdata5.aspx&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;^\"(?&amp;lt;file_name&amp;gt;\w.*)\"\,\"(?&amp;lt;links_emb&amp;gt;\w.*)\"&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 13:57:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695259#M236427</guid>
      <dc:creator>ravir_jbp</dc:creator>
      <dc:date>2024-08-05T13:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to query csv raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695280#M236429</link>
      <description>&lt;P&gt;Do you mean something like this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;^\"(?&amp;lt;file_name&amp;gt;[^\"]*)\"\,\"(?&amp;lt;links_emb&amp;gt;[^\"]*)\"&lt;/LI-CODE&gt;&lt;P&gt;Or is this one event that you want to split into multiple lines?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 14:56:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695280#M236429</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-08-05T14:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to query csv raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695281#M236430</link>
      <description>&lt;P&gt;actual want to splink into miultiple lines.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 15:02:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695281#M236430</guid>
      <dc:creator>ravir_jbp</dc:creator>
      <dc:date>2024-08-05T15:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to query csv raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695282#M236431</link>
      <description>&lt;P&gt;actually need to convert each line into seperate event so that each line can be counted correctly.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 15:07:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695282#M236431</guid>
      <dc:creator>ravir_jbp</dc:creator>
      <dc:date>2024-08-05T15:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to query csv raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695285#M236433</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;currently csv raw data refelcting in splunk as mentioed below: If you notice event at&amp;nbsp;2:48:32.000 AM there are multiple csv lines, which is causing confusion.&amp;nbsp; I am looking for splunk out put as mentioned in&amp;nbsp;2:49:30.000 AM and&amp;nbsp;2:50:30.000 AM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;8/5/24&lt;/P&gt;&lt;P&gt;2:48:32.000 AM&lt;BR /&gt;"filename_Time15151515.html","&lt;A href="http://testdata1.html" target="_blank" rel="noopener"&gt;http://testdata1.html&lt;/A&gt;"&lt;BR /&gt;"filename_Time15151515.html","&lt;A href="http://testdata2.gif" target="_blank" rel="noopener"&gt;http://testdata2.gif&lt;/A&gt;"&lt;BR /&gt;"filename_Time15151515.html",""&lt;A href="http://testdata3.doc" target="_blank" rel="noopener"&gt;http://testdata3.doc&lt;/A&gt;"&lt;BR /&gt;"filename_Time15151515.html",""&lt;A href="http://testdata4.xls" target="_blank" rel="noopener"&gt;http://testdata4.xls&lt;/A&gt;"&lt;BR /&gt;"filename_Time15151515.html",""&lt;A href="http://testdata5.aspx" target="_blank" rel="noopener"&gt;http://testdata5.aspx&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;2:49:30.000 AM&lt;BR /&gt;"filename_Time15151515.html",""&lt;A href="http://testtest.aspx" target="_blank" rel="noopener"&gt;http://testtest.aspx&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;2:50:30.000 AM&lt;BR /&gt;"filename_Time46657555.html",""&lt;A href="http://tessttestsest.aspx" target="_blank" rel="noopener"&gt;http://tessttestsest.aspx&lt;/A&gt;"&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 15:18:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695285#M236433</guid>
      <dc:creator>ravir_jbp</dc:creator>
      <dc:date>2024-08-05T15:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to query csv raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695288#M236434</link>
      <description>&lt;P&gt;Assuming the filenames are in a field called filenames, you could try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval filenames=split(filenames,"
")
| mvexpand filenames
| rex field=filenames "\"(?&amp;lt;file&amp;gt;[^\"]+)\",\"(?&amp;lt;url&amp;gt;[^\"]+)\""&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 05 Aug 2024 15:40:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695288#M236434</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-08-05T15:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to query csv raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695294#M236435</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;As you are suggesting to use;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=indexname host=server source="/SEM/Emblinksautomation/UploadEmblinks/Uploadlinks.csv"
| rex "^\"(?&amp;lt;filename&amp;gt;[^\"]*)\"\,\"(?&amp;lt;url&amp;gt;[^\"]*)\""
| eval filename=split(filename,"")
| mvexpand filename
| rex field=filename "\"(?&amp;lt;file&amp;gt;[^\"]+)\",\"(?&amp;lt;url&amp;gt;[^\"]+)\""&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 15:57:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695294#M236435</guid>
      <dc:creator>ravir_jbp</dc:creator>
      <dc:date>2024-08-05T15:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to query csv raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695300#M236436</link>
      <description>&lt;P&gt;It depends on what you events look like i.e. what the fields are called and what is in them. You should give more accurate information as I don't have access to your data and only know what you have shared so far.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 16:00:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695300#M236436</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-08-05T16:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to query csv raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695306#M236437</link>
      <description>&lt;P&gt;Okay let me show the exact requirment. Now if you look at the event below. Below data is coming from CSV data. Now 1st event&amp;nbsp; has muliple csv lines, which is creating confusion when counting the data. These multile events are counted has one event which is not the case. But if you look at second even which has one row with filename and link. I need to seperate 1st event (which has multple lines) into spereate events and need to use table command to list the data in the dashboard.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I am runing the regex it shows on 24000 records. But in CSV the files line counts are more than 200000 count. Which is not matching. Not sure why splunk is reading mulitple rows into 1 event.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 03:52:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695306#M236437</guid>
      <dc:creator>ravir_jbp</dc:creator>
      <dc:date>2024-08-06T03:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to query csv raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695311#M236438</link>
      <description>&lt;P&gt;OK it looks like all your data is in _raw?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval filenames=split(_raw,"
")
| mvexpand filenames
| rex field=filenames "\"(?&amp;lt;file&amp;gt;[^\"]+)\",\"(?&amp;lt;url&amp;gt;[^\"]+)\""&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 05 Aug 2024 16:36:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695311#M236438</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-08-05T16:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to query csv raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695313#M236439</link>
      <description>&lt;P&gt;First, a table "row" in CSV is not defined by linefeed in the document. &amp;nbsp;If some of your ingested CSV events do not contain CSV header, you need to focus on fixing the ingestion linebreaker problem. &amp;nbsp;No amount of regex can save broken ingestion and corrupt raw events.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 16:43:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695313#M236439</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-08-05T16:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to query csv raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695314#M236440</link>
      <description>&lt;P&gt;This is still not working. Data count is not matching. Can you confirm the complete query again:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=index host=server source="/UploadEmblinks/Uploadlinks.csv"
| rex "^\"(?&amp;lt;filenames&amp;gt;[^\"]*)\"\,\"(?&amp;lt;url&amp;gt;[^\"]*)\""
| eval filenames=split(_raw,"")
| mvexpand filenames
| rex field=filenames "\"(?&amp;lt;file&amp;gt;[^\"]+)\",\"(?&amp;lt;url&amp;gt;[^\"]+)\""&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 05 Aug 2024 18:39:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695314#M236440</guid>
      <dc:creator>ravir_jbp</dc:creator>
      <dc:date>2024-08-05T18:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to query csv raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695316#M236441</link>
      <description>&lt;P&gt;Paste your search into a code block (like I have with mine) so it preserves formatting.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 16:46:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695316#M236441</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-08-05T16:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to query csv raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695320#M236442</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=index host=host  source="/Emblinksautomation/UploadEmblinks/Uploadlinks.csv" 
| rex "^\"(?&amp;lt;filenames&amp;gt;[^\"]*)\"\,\"(?&amp;lt;url&amp;gt;[^\"]*)\""
| eval filenames=split(_raw,"")
| mvexpand filenames
| rex field=filenames "\"(?&amp;lt;file&amp;gt;[^\"]+)\",\"(?&amp;lt;url&amp;gt;[^\"]+)\""&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 05 Aug 2024 16:54:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695320#M236442</guid>
      <dc:creator>ravir_jbp</dc:creator>
      <dc:date>2024-08-05T16:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to query csv raw data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695323#M236443</link>
      <description>&lt;P&gt;You are missing the new line in the split command as shown in my suggestion - try using the command exactly as I suggested&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 17:12:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-query-csv-raw-data/m-p/695323#M236443</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-08-05T17:12:59Z</dc:date>
    </item>
  </channel>
</rss>

