Automatically Export fiddler data

4 posts, 0 answers
  1. Anshu
    Anshu avatar
    2 posts
    Member since:
    Dec 2018

    Posted 05 Dec 2018 Link to this post

    Hi Eric,

    Thanks for the fiddler tool.

    Actually i want to automatically export fiddler data to my pc  and i don't know how to do this.

    So i request you to please help me in this.

     

     

    Regards

    Anshu

  2. Simeon
    Admin
    Simeon avatar
    216 posts

    Posted 13 Dec 2018 Link to this post

    Hi Anshu,

    Fiddler has an AutoSave tab. I believe that this is what you are looking for. To show the AutoSave tab click on the View\Tabs\AutoSave menu.

    You can configure automatic saves to take place at an interval ranging from 1 minute to 12 hours. Check the Automatically save capture files box to enable the timer, which will be displayed to the right.

    Check the Save Headers Only box if you only wish to preserve the request and response headers in the SAZ file; this option can be useful for minimizing the size of the archive if only headers are needed.

    Click the Target Folder link to display a folder picker dialog box. Click the Open button to open Windows Explorer to the specified folder.

    The Log box at the bottom of the screen stores information about saved files.

    After the SAZ file is saved, the saved Sessions are removed from the Web Sessions list and a garbage collection operation is initiated to reclaim as much memory as possible.

    You could find out more on how to utilize the full power of Fiddler in The Fiddler Book.

    Regards,
    Simeon
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Anshu
    Anshu avatar
    2 posts
    Member since:
    Dec 2018

    Posted 13 Dec 2018 in reply to Simeon Link to this post

    Hi Simeon,

     

    Thanks for response. Data save in SAZ format which is automatically export. I want to export automatically in txt format.

    If there is any method then please let me know.

     

    Regards

    Anshu

  4. Simeon
    Admin
    Simeon avatar
    216 posts

    Posted 19 Dec 2018 Link to this post

    Hi Anshu,

    You could achieve this with the FiddlerScript. I managed to write a quick code sample with the C# script which you could tailor according to your needs:
    using System.IO;
     
    ...
     
    namespace Fiddler
    {
        public static class Handlers
        {
            private static readonly Timer timer = new Timer();
     
            ...
     
            public static void Main()
            {
                ...
                InitializeAutoSave();
            }
     
            private static void InitializeAutoSave()
            {
                timer.Tick += timer_Tick;
                timer.Interval = 5000;
                timer.Start();
            }
              
            private static void timer_Tick(object sender, EventArgs e)
            {
                 Session[] allSessions = FiddlerApplication.UI.GetAllSessions();
     
                 if (allSessions.Length == 0) return;
     
                 List<Session> completedSessions = new List<Session>();
                 foreach (Session session in allSessions)
                 {
                     if (session.state < SessionStates.Done) continue;
     
                     completedSessions.Add(session);
                 }
     
                 if (completedSessions.Count ==0) return;
     
                 string filename = @"\path\to\sessions.txt";
     
                 if (!File.Exists(filename)) File.Create(filename);
     
                 using (FileStream fs = new FileStream(filename, FileMode.Truncate, FileAccess.Write))
                 {
                     foreach (Session session in completedSessions)
                     {
                         session.WriteToStream(fs, false);
                     }
                 }
         
                FiddlerApplication.UI.actRemoveRange(completedSessions);
            }


    Regards,
    Simeon
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top